Hen1ng commented on PR #1722:
URL: https://github.com/apache/fury/pull/1722#issuecomment-2342512316

   Benchmark                                  (size)  (tracking)  Mode  Cnt     
 Score      Error  Units
   HnBenchmark.testGeneralChunkWriteWithNull      64        true  avgt   15   
1228.736 ±  153.330  ns/op
   HnBenchmark.testGeneralChunkWriteWithNull      64       false  avgt   15   
1150.012 ±   83.370  ns/op
   HnBenchmark.testGeneralChunkWriteWithNull     128        true  avgt   15   
2393.119 ±  168.874  ns/op
   HnBenchmark.testGeneralChunkWriteWithNull     128       false  avgt   15   
2607.314 ±  463.271  ns/op
   HnBenchmark.testGeneralChunkWriteWithNull     256        true  avgt   15   
4554.671 ±   91.605  ns/op
   HnBenchmark.testGeneralChunkWriteWithNull     256       false  avgt   15   
4977.650 ± 1019.474  ns/op
   HnBenchmark.testGeneralWriteWithNull           64        true  avgt   15   
1935.727 ± 1269.534  ns/op
   HnBenchmark.testGeneralWriteWithNull           64       false  avgt   15   
1704.501 ±  604.193  ns/op
   HnBenchmark.testGeneralWriteWithNull          128        true  avgt   15   
2741.738 ±  664.690  ns/op
   HnBenchmark.testGeneralWriteWithNull          128       false  avgt   15   
2431.270 ±   65.081  ns/op
   HnBenchmark.testGeneralWriteWithNull          256        true  avgt   15   
5496.098 ±  117.704  ns/op
   HnBenchmark.testGeneralWriteWithNull          256       false  avgt   15   
5845.516 ±   90.525  ns/op
   
   
   ```java
   @State(Scope.Benchmark)
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   @Warmup(iterations = 3, time = 3)
   @Measurement(iterations = 3, time = 5)
   @Threads(1)
   @Fork(5)
   public class HnBenchmark {
   
     private Fury furyMapChunk;
     private Fury fury;
     Map<Integer, Integer> map;
     MapBean mapBean = new MapBean();
     Map<BeanB, BeanB> beanBBeanBMap = new HashMap<>();
     Bean bean;
   
     @Param({"64", "128", "256"})
     int size;
   
       @Param({"true", "false"})
     boolean tracking = false;
   
   
     @Setup(Level.Trial)
     public void init() {
       furyMapChunk =
           Fury.builder()
               .withLanguage(Language.JAVA)
               .withRefTracking(tracking)
               .withCodegen(false)
               .withChunkSerializeMapEnable(true)
               .requireClassRegistration(false)
               .build();
       fury =
           Fury.builder()
               .withLanguage(Language.JAVA)
               .withRefTracking(tracking)
               .withCodegen(false)
               .withChunkSerializeMapEnable(false)
               .requireClassRegistration(false)
               .build();
       map = new HashMap<>(size);
       for (int i = 0; i < size; i++) {
         if ( i == 0) {
           map.put(null, i);
           beanBBeanBMap.put(null, new BeanB());
           continue;
         }
         if (i == 10) {
           map.put(i, null);
           beanBBeanBMap.put(new BeanB(), null);
           continue;
         }
         map.put(i, i);
         beanBBeanBMap.put(new BeanB(), new BeanB());
       }
       bean = new Bean();
       bean.setMap(map);
       mapBean.setMap(beanBBeanBMap);
     }
   
       @Benchmark
     public void testGeneralChunkWriteWithNull() {
       final byte[] serialize = furyMapChunk.serialize(map);
     }
   
     @Benchmark
     public void testGeneralWriteWithNull() {
       final byte[] serialize = fury.serialize(map);
     }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to