dmsolr commented on issue #3021: Using ArryList instead of LinkedList URL: https://github.com/apache/skywalking/pull/3021#issuecomment-509896369 Thank both of you. I ran two scenarios. 1. run benchmark tests with ArrayList and LinkedList. 2. run simulate real-world testing. The first of all, I need to explain two about this changes. 1. In constructor, I use ArrayList to store DataSource and the ArrayList size is from 1. This is why we just use it at initialization. And its length must less 100. So ArrayList or LinkedList is amlost the same here. 2. In ComsumerThread#consume(), I use singleton ArrayList instance to avoid recreate and continuely grow. that means Array grownth is approaching to bufferSize(in MultiConsumerThread, it is less several times than bufferSize). And then it never grow. Second, How do I design test case for simulate real-world testing. Using `io.dropwizard.metrics` to trace GC and elapsed time. So I create a DataCarrier with 4-channels and 1000/2000/4000-buffers. And then I add 32-thread producer for continuely produce and 32-ConsumerThread for consume.   Here is the result: (It ran in Aliyun VM 2core, 4G) ## before changing. * channelSize = 4 * bufferSize = 2000 * numThreads = 32 * run 3-mins ============================================================ -- Gauges ---------------------------------------------------------------------- PS-MarkSweep.count value = 0 PS-MarkSweep.time value = 0 PS-Scavenge.count value = 332 PS-Scavenge.time value = 477 -- Timers ---------------------------------------------------------------------- ConsumerThread.1 count = 613190 mean rate = 3404.58 calls/second 1-minute rate = 3408.83 calls/second 5-minute rate = 3390.47 calls/second 15-minute rate = 3382.55 calls/second min = 0.00 milliseconds max = 2.46 milliseconds mean = 0.01 milliseconds stddev = 0.12 milliseconds median = 0.00 milliseconds 75% <= 0.01 milliseconds 95% <= 0.02 milliseconds 98% <= 0.03 milliseconds 99% <= 0.03 milliseconds 99.9% <= 2.46 milliseconds ## after changing. * channelSize = 4 * bufferSize = 2000 * numThreads = 32 * run 3-mins ============================================================ -- Gauges ---------------------------------------------------------------------- PS-MarkSweep.count value = 0 PS-MarkSweep.time value = 0 PS-Scavenge.count value = 107 PS-Scavenge.time value = 131 -- Timers ---------------------------------------------------------------------- ConsumerThread.1 count = 621289 mean rate = 3449.42 calls/second 1-minute rate = 3439.23 calls/second 5-minute rate = 3431.61 calls/second 15-minute rate = 3423.44 calls/second min = 0.00 milliseconds max = 0.02 milliseconds mean = 0.00 milliseconds stddev = 0.00 milliseconds median = 0.00 milliseconds 75% <= 0.00 milliseconds 95% <= 0.00 milliseconds 98% <= 0.01 milliseconds 99% <= 0.01 milliseconds 99.9% <= 0.02 milliseconds
---------------------------------------------------------------- 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
