This commit is contained in:
Sander Hautvast 2016-01-05 20:26:03 +01:00
parent a947f14f35
commit d1383e47c9
5 changed files with 3 additions and 103 deletions

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/commons-io/commons-io/1.4/a8762d07e76cfde2395257a5da47ba7c1dbd3dce/commons-io-1.4.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/commons-io/commons-io/1.4/48753e43ff29409fbbeadfb36186cbe27e41b179/commons-io-1.4-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/org.javassist/javassist/3.20.0-GA/a9cbcdfb7e9f86fbc74d3afae65f2248bfbf82a0/javassist-3.20.0-GA.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/org.javassist/javassist/3.20.0-GA/d8fdc08a455bc0b28bc0bed1f0d032d935cee8e1/javassist-3.20.0-GA-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/0.9.29/96bf09771ee37a15e8e096dbf4a586e964c2f91f/logback-core-0.9.29.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/0.9.29/d8fc5a9bbc78693a9cd240add2b85af10731ee47/logback-core-0.9.29-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.6.1/6f3b8a24bf970f17289b234284c94f43eb42f0e4/slf4j-api-1.6.1.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.6.1/46a386136c901748e6a3af67ebde6c22bc6b4524/slf4j-api-1.6.1-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/0.9.29/f69dbab16e4cf256bdc397d7a745e86507f3a98b/logback-classic-0.9.29.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/0.9.29/3dabd1c3a2aedb5a85cf522e4f478bb5e4156355/logback-classic-0.9.29-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/junit/junit/4.8.2/c94f54227b08100974c36170dcb53329435fe5ad/junit-4.8.2.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/junit/junit/4.8.2/cccca612a66b8387c399be31d69daf000de2ac9e/junit-4.8.2-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/1.9.5/c3264abeea62c4d2f367e21484fbb40c7e256393/mockito-core-1.9.5.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/1.9.5/46f703fb4266140c544d48a189cb25947eb6333e/mockito-core-1.9.5-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.6.1/45c37a03be19f3e0db825fd7814d0bbec40b9e0/jackson-databind-2.6.1.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.6.1/56c55af2ce78286195b16521a82b331cc92cae0/jackson-databind-2.6.1-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.1/860340562250678d1a344907ac75754e259cdb14/hamcrest-core-1.1.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.1/2ccf1154d1a8936042a8a742dc3e611d02ac7213/hamcrest-core-1.1-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/1.0/9b473564e792c2bdf1449da1f0b1b5bff9805704/objenesis-1.0.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/1.0/b10c90e57b7bb985a7b6a704769428fe5c2a732c/objenesis-1.0-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.6.0/a0990e2e812ac6639b6ce955c91b13228500476e/jackson-annotations-2.6.0.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.6.0/7bcb615d523d88acbc121c92aafeba8d37a83792/jackson-annotations-2.6.0-sources.jar"/>
<classpathentry exported="true" kind="lib" path="D:/gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.6.1/892d15011456ea3563319b27bdd612dbc89bb776/jackson-core-2.6.1.jar" sourcepath="D:/gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.6.1/c0063bb450c53bfa3136dc868e1062d714187e2/jackson-core-2.6.1-sources.jar"/>
<classpathentry kind="lib" path="json-smart-1.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
/bin/
/.classpath
/.settings/

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SyntheticSerializer</name>
<comment/>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<linkedResources/>
</projectDescription>

View file

@ -1,13 +0,0 @@
#
#Tue Aug 18 20:35:37 CEST 2015
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

View file

@ -1,54 +0,0 @@
package nl.jssl.ss.performance;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import net.minidev.json.JSONValue;
import nl.jssl.ss.Serializer;
import nl.jssl.ss.nested.Bean1;
import nl.jssl.ss.nested.Bean2;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class SmartJson {
public void jackson() throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
Bean1 bean1 = new Bean1();
Bean2 bean2 = new Bean2();
bean1.setData1(UUID.randomUUID().toString());
bean1.setBean2(bean2);
bean2.setData2(UUID.randomUUID().toString());
Serializer.toJSONString(bean1);
JSONValue.toJSONString(bean1);
for (int c = 0; c < 200; c++) {
System.gc();
long t0 = System.currentTimeMillis();
List<String> trashbin = new ArrayList<String>();
for (int i = 0; i < 10000; i++) {
bean1.setData1(UUID.randomUUID().toString());
bean1.setBean2(bean2);
bean2.setData2(UUID.randomUUID().toString());
String valueAsString = JSONValue.toJSONString(bean1);
trashbin.add(valueAsString);
}
System.out.print(System.currentTimeMillis() - t0);
System.out.print(",");
trashbin.clear();
System.gc();
long tt0 = System.currentTimeMillis();
for (int i = 0; i < 10000; i++) {
bean1.setData1(UUID.randomUUID().toString());
bean1.setBean2(bean2);
bean2.setData2(UUID.randomUUID().toString());
String jsonString = Serializer.toJSONString(bean1);
// System.out.println(jsonString);
trashbin.add(jsonString);
}
System.out.println(System.currentTimeMillis() - tt0);
}
}
}