Examples of LightSerializationContext


Examples of com.bubble.serializer.LightSerializationContext

  }


  public void testBubbleSpeedMany() {
    Pojo[] pojos;
    LightSerializationContext context = new LightSerializationContext();
    ByteBuffer buffer = ByteBuffer.allocate(32768);
    long startTime = System.currentTimeMillis();
    for(int j = 0; j < PASSES ; j++) {
      buffer.clear();
      pojos = initPojos();
      for (int i = 0; i < pojos.length; i++) {
        context.serialize(pojos[i], buffer);
      }
    }
    long endTime = System.currentTimeMillis();
    long delay = endTime-startTime;
    System.out.println("Bubble many time: "+delay+"ms");
View Full Code Here

Examples of com.bubble.serializer.LightSerializationContext

  }

 
  public long testLightSerialize() throws Exception {
    FileChannel channel = new FileOutputStream(filePrefix).getChannel();     
    LightSerializationContext sc = new LightSerializationContext();
    ByteBuffer buffer = ByteBuffer.allocateDirect(102400);
    long start = System.currentTimeMillis();
    for (int i = 0; i < loops; i++) {
      testObject = createTestObject();
      sc.serialize(testObject, buffer);
      buffer.flip();
      channel.write(buffer);     
      buffer.clear();
    }
    long total = System.currentTimeMillis()- start;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.