wu-sheng commented on issue #3064: To improve DataCarrier URL: https://github.com/apache/skywalking/issues/3064#issuecomment-511329195 FYI @hanahmily @peng-yongsheng @kezhenxu94 @JaredTan95 @zhaoyuguang @IanCao According to all these tests, the ArrayList is much faster than LinkedList, especially in list reuse scenario, even including the GC time Highlight this one ``` Benchmark Mode Cnt Score Error Units LinkedArrayBenchmark.testReusedArray thrpt 5 4.099 ± 0.254 ops/s LinkedArrayBenchmark.testReusedArray:·gc.alloc.rate thrpt 5 3577.493 ± 218.971 MB/sec LinkedArrayBenchmark.testReusedArray:·gc.alloc.rate.norm thrpt 5 960569530.436 ± 0.529 B/op LinkedArrayBenchmark.testReusedArray:·gc.churn.PS_Eden_Space thrpt 5 3579.288 ± 227.314 MB/sec LinkedArrayBenchmark.testReusedArray:·gc.churn.PS_Eden_Space.norm thrpt 5 961045357.161 ± 7069943.693 B/op LinkedArrayBenchmark.testReusedArray:·gc.churn.PS_Survivor_Space thrpt 5 2.369 ± 0.343 MB/sec LinkedArrayBenchmark.testReusedArray:·gc.churn.PS_Survivor_Space.norm thrpt 5 636105.700 ± 95920.377 B/op LinkedArrayBenchmark.testReusedArray:·gc.count thrpt 5 1133.000 counts LinkedArrayBenchmark.testReusedArray:·gc.time thrpt 5 3254.000 ms LinkedArrayBenchmark.testReusedLinked thrpt 5 1.578 ± 0.068 ops/s LinkedArrayBenchmark.testReusedLinked:·gc.alloc.rate thrpt 5 2753.590 ± 112.877 MB/sec LinkedArrayBenchmark.testReusedLinked:·gc.alloc.rate.norm thrpt 5 1920000059.000 ± 0.001 B/op LinkedArrayBenchmark.testReusedLinked:·gc.churn.PS_Eden_Space thrpt 5 2752.897 ± 113.153 MB/sec LinkedArrayBenchmark.testReusedLinked:·gc.churn.PS_Eden_Space.norm thrpt 5 1919516672.000 ± 713769.991 B/op LinkedArrayBenchmark.testReusedLinked:·gc.churn.PS_Survivor_Space thrpt 5 6.904 ± 0.680 MB/sec LinkedArrayBenchmark.testReusedLinked:·gc.churn.PS_Survivor_Space.norm thrpt 5 4813619.200 ± 404066.441 B/op LinkedArrayBenchmark.testReusedLinked:·gc.count thrpt 5 885.000 counts LinkedArrayBenchmark.testReusedLinked:·gc.time thrpt 5 2996.000 ms ``` 3x times faster. I recommend you 1. Use a 2k~ as ArrayList initial size(agent uses 1.5k as default), because not all OAPs run in the full payload. 1. Use array reuse mechanism in DataCarrier consumer, especially in `BulkConsumePool`(OAP used). Let's work on a PR to make this works. cc all @apache/skywalking-committers
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
