GitHub user original-brownbear reopened a pull request: https://github.com/apache/kafka/pull/2903
MINOR: Fix needless GC + Result time unit in JMH Fixes two issues with the JMH benchmark example: * Trivial: The output should be in `ops/ms` for readability reasons (it's in the millions of operations per second) * Important: The benchmark is not actually measuring the LRU-Cache performance as most of the time in each run is wasted on concatenating `key + counter` as well as `value + counter`. Fixed by pre-generating 10k K-V pairs (100x the cache capacity) and iterating over them. This brings the performance up by a factor of more than 5 on a standard 4 core i7 (`~6k/ms` before goes to `~35k/ms`). * Also made static what could be made static in the benchmark class to lower the GC background noise You can merge this pull request into a Git repository by running: $ git pull https://github.com/original-brownbear/kafka fix-jmh-example Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/2903.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2903 ---- commit 8d30ef0f3e35f1fa03e035796f4e4d125bde4548 Author: Armin Braun <m...@obrown.io> Date: 2017-04-24T06:50:57Z MINOR: Fix needless GC + Result time unit in JMH commit 2dbbd4cf1d5d06bb154a3436aa8752d3bb89fc9e Author: Armin Braun <m...@obrown.io> Date: 2017-04-24T09:10:21Z MINOR: Fix needless GC + Result time unit in JMH commit f5e46a7e2fbe3d8b4bc8f1817ce55cfbe821f067 Author: Armin Braun <m...@obrown.io> Date: 2017-04-24T09:13:44Z MINOR: Fix needless GC + Result time unit in JMH ---- ---