use of voldemort.serialization.json.JsonTypeDefinition in project voldemort by voldemort.
the class TestSerialization method main.
public static void main(String[] args) {
JsonTypeDefinition def = JsonTypeDefinition.fromJson("[\"int32\"]");
int size = 30000;
List<Integer> value = new ArrayList<Integer>(size);
for (int i = 0; i < size; i++) value.add(i);
JsonTypeSerializer ser = new JsonTypeSerializer(def);
long start = System.currentTimeMillis();
int iters = 100;
List<byte[]> bytes = new ArrayList<byte[]>(iters);
for (int i = 0; i < iters; i++) bytes.add(ser.toBytes(value));
long elapsed = System.currentTimeMillis() - start;
System.out.println("Took " + (elapsed / iters) + " ms");
}
Aggregations