Instantly share code, notes, and snippets.

Embed
What would you like to do?
Java collection iteration benchmark results (JMH)
18:15:58: Executing task 'jmh'...
:compileJava NO-SOURCE
:compileGroovy NO-SOURCE
:processResources NO-SOURCE
:classes UP-TO-DATE
:compileTestJava NO-SOURCE
:compileTestGroovy NO-SOURCE
:processTestResources NO-SOURCE
:testClasses UP-TO-DATE
:compileJmhJava
:compileJmhGroovy
:processJmhResources NO-SOURCE
:jmhClasses
:jmhRunBytecodeGenerator
Processing 1 classes from /home/wololock/workspace/groovy-jmh/build/classes/java/jmh with "reflection" generator
Processing 4 classes from /home/wololock/workspace/groovy-jmh/build/classes/groovy/jmh with "reflection" generator
Writing out Java source to /home/wololock/workspace/groovy-jmh/build/jmh-generated-sources and resources to /home/wololock/workspace/groovy-jmh/build/jmh-generated-resources
:jmhCompileGeneratedClasses
:jmhJar
:jmh
# JMH version: 1.21
# VM version: JDK 1.8.0_162, Java HotSpot(TM) 64-Bit Server VM, 25.162-b12
# VM invoker: /usr/java/jdk1.8.0_162/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 60 s each
# Measurement: 120 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.JavaBench.javaForEach
# Run progress: 75,00% complete, ETA 00:06:23
# Fork: 1 of 1
# Warmup Iteration 1: 8,852 ms/op
Iteration 1: 8,988 ms/op
Iteration 2: 8,816 ms/op
Iteration 3: 8,794 ms/op
Iteration 4: 8,828 ms/op
Iteration 5: 8,800 ms/op
Iteration 6: 8,850 ms/op
Iteration 7: 8,859 ms/op
Iteration 8: 8,843 ms/op
Iteration 9: 8,913 ms/op
Iteration 10: 8,803 ms/op
Iteration 11: 8,857 ms/op
Iteration 12: 8,858 ms/op
Iteration 13: 8,873 ms/op
Iteration 14: 8,849 ms/op
Iteration 15: 8,806 ms/op
Iteration 16: 8,823 ms/op
Iteration 17: 8,793 ms/op
Iteration 18: 8,821 ms/op
Iteration 19: 8,816 ms/op
Iteration 20: 8,843 ms/op
Iteration 21: 8,858 ms/op
Iteration 22: 8,856 ms/op
Iteration 23: 8,789 ms/op
Iteration 24: 8,823 ms/op
Iteration 25: 8,786 ms/op
Iteration 26: 8,847 ms/op
Iteration 27: 8,857 ms/op
Iteration 28: 8,864 ms/op
Iteration 29: 8,891 ms/op
Iteration 30: 8,862 ms/op
Iteration 31: 8,838 ms/op
Iteration 32: 8,834 ms/op
Iteration 33: 8,835 ms/op
Iteration 34: 8,794 ms/op
Iteration 35: 8,868 ms/op
Iteration 36: 8,806 ms/op
Iteration 37: 8,845 ms/op
Iteration 38: 8,787 ms/op
Iteration 39: 8,788 ms/op
Iteration 40: 8,788 ms/op
Iteration 41: 8,868 ms/op
Iteration 42: 8,822 ms/op
Iteration 43: 8,871 ms/op
Iteration 44: 8,816 ms/op
Iteration 45: 8,810 ms/op
Iteration 46: 8,859 ms/op
Iteration 47: 8,876 ms/op
Iteration 48: 8,880 ms/op
Iteration 49: 8,874 ms/op
Iteration 50: 8,865 ms/op
Iteration 51: 8,847 ms/op
Iteration 52: 8,881 ms/op
Iteration 53: 8,867 ms/op
Iteration 54: 8,868 ms/op
Iteration 55: 8,841 ms/op
Iteration 56: 8,906 ms/op
Iteration 57: 8,844 ms/op
Iteration 58: 8,833 ms/op
Iteration 59: 8,827 ms/op
Iteration 60: 8,830 ms/op
Iteration 61: 8,835 ms/op
Iteration 62: 8,852 ms/op
Iteration 63: 8,755 ms/op
Iteration 64: 8,911 ms/op
Iteration 65: 8,828 ms/op
Iteration 66: 8,866 ms/op
Iteration 67: 8,825 ms/op
Iteration 68: 8,840 ms/op
Iteration 69: 8,788 ms/op
Iteration 70: 8,864 ms/op
Iteration 71: 8,856 ms/op
Iteration 72: 8,850 ms/op
Iteration 73: 8,878 ms/op
Iteration 74: 8,839 ms/op
Iteration 75: 8,823 ms/op
Iteration 76: 8,833 ms/op
Iteration 77: 8,952 ms/op
Iteration 78: 8,831 ms/op
Iteration 79: 8,932 ms/op
Iteration 80: 8,845 ms/op
Iteration 81: 8,798 ms/op
Iteration 82: 8,841 ms/op
Iteration 83: 8,807 ms/op
Iteration 84: 8,826 ms/op
Iteration 85: 8,827 ms/op
Iteration 86: 8,837 ms/op
Iteration 87: 8,831 ms/op
Iteration 88: 8,882 ms/op
Iteration 89: 8,826 ms/op
Iteration 90: 8,816 ms/op
Iteration 91: 8,805 ms/op
Iteration 92: 8,800 ms/op
Iteration 93: 8,830 ms/op
Iteration 94: 8,815 ms/op
Iteration 95: 8,865 ms/op
Iteration 96: 8,817 ms/op
Iteration 97: 8,861 ms/op
Iteration 98: 8,798 ms/op
Iteration 99: 8,817 ms/op
Iteration 100: 8,875 ms/op
Iteration 101: 8,862 ms/op
Iteration 102: 8,788 ms/op
Iteration 103: 8,852 ms/op
Iteration 104: 8,865 ms/op
Iteration 105: 8,861 ms/op
Iteration 106: 8,835 ms/op
Iteration 107: 8,854 ms/op
Iteration 108: 8,838 ms/op
Iteration 109: 8,849 ms/op
Iteration 110: 8,803 ms/op
Iteration 111: 8,827 ms/op
Iteration 112: 8,801 ms/op
Iteration 113: 8,829 ms/op
Iteration 114: 8,778 ms/op
Iteration 115: 8,808 ms/op
Iteration 116: 8,776 ms/op
Iteration 117: 8,836 ms/op
Iteration 118: 8,802 ms/op
Iteration 119: 8,849 ms/op
Iteration 120: 8,812 ms/op
Result "bench.JavaBench.javaForEach":
8,839 ±(99.9%) 0,011 ms/op [Average]
(min, avg, max) = (8,755, 8,839, 8,988), stdev = 0,036
CI (99.9%): [8,828, 8,850] (assumes normal distribution)
# JMH version: 1.21
# VM version: JDK 1.8.0_162, Java HotSpot(TM) 64-Bit Server VM, 25.162-b12
# VM invoker: /usr/java/jdk1.8.0_162/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 60 s each
# Measurement: 120 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.JavaBench.javaIteratorTest
# Run progress: 87,50% complete, ETA 00:03:10
# Fork: 1 of 1
# Warmup Iteration 1: 8,854 ms/op
Iteration 1: 8,854 ms/op
Iteration 2: 8,897 ms/op
Iteration 3: 8,828 ms/op
Iteration 4: 8,873 ms/op
Iteration 5: 8,824 ms/op
Iteration 6: 8,911 ms/op
Iteration 7: 8,882 ms/op
Iteration 8: 8,864 ms/op
Iteration 9: 8,848 ms/op
Iteration 10: 9,030 ms/op
Iteration 11: 8,869 ms/op
Iteration 12: 8,888 ms/op
Iteration 13: 8,869 ms/op
Iteration 14: 8,858 ms/op
Iteration 15: 8,923 ms/op
Iteration 16: 8,829 ms/op
Iteration 17: 8,888 ms/op
Iteration 18: 8,841 ms/op
Iteration 19: 8,861 ms/op
Iteration 20: 8,859 ms/op
Iteration 21: 8,866 ms/op
Iteration 22: 8,809 ms/op
Iteration 23: 8,852 ms/op
Iteration 24: 8,853 ms/op
Iteration 25: 8,880 ms/op
Iteration 26: 8,831 ms/op
Iteration 27: 8,915 ms/op
Iteration 28: 8,830 ms/op
Iteration 29: 8,877 ms/op
Iteration 30: 8,929 ms/op
Iteration 31: 8,885 ms/op
Iteration 32: 8,844 ms/op
Iteration 33: 8,853 ms/op
Iteration 34: 8,851 ms/op
Iteration 35: 8,890 ms/op
Iteration 36: 8,835 ms/op
Iteration 37: 8,871 ms/op
Iteration 38: 8,918 ms/op
Iteration 39: 8,809 ms/op
Iteration 40: 8,878 ms/op
Iteration 41: 8,855 ms/op
Iteration 42: 8,883 ms/op
Iteration 43: 8,807 ms/op
Iteration 44: 8,880 ms/op
Iteration 45: 8,848 ms/op
Iteration 46: 8,846 ms/op
Iteration 47: 8,853 ms/op
Iteration 48: 8,863 ms/op
Iteration 49: 8,868 ms/op
Iteration 50: 8,913 ms/op
Iteration 51: 8,827 ms/op
Iteration 52: 8,883 ms/op
Iteration 53: 8,856 ms/op
Iteration 54: 8,834 ms/op
Iteration 55: 8,882 ms/op
Iteration 56: 8,888 ms/op
Iteration 57: 8,861 ms/op
Iteration 58: 8,883 ms/op
Iteration 59: 8,851 ms/op
Iteration 60: 8,820 ms/op
Iteration 61: 8,873 ms/op
Iteration 62: 8,800 ms/op
Iteration 63: 8,822 ms/op
Iteration 64: 8,816 ms/op
Iteration 65: 8,900 ms/op
Iteration 66: 8,846 ms/op
Iteration 67: 8,866 ms/op
Iteration 68: 8,897 ms/op
Iteration 69: 8,805 ms/op
Iteration 70: 8,809 ms/op
Iteration 71: 8,867 ms/op
Iteration 72: 8,868 ms/op
Iteration 73: 8,880 ms/op
Iteration 74: 8,845 ms/op
Iteration 75: 8,839 ms/op
Iteration 76: 8,837 ms/op
Iteration 77: 8,868 ms/op
Iteration 78: 8,819 ms/op
Iteration 79: 8,939 ms/op
Iteration 80: 8,853 ms/op
Iteration 81: 8,861 ms/op
Iteration 82: 8,935 ms/op
Iteration 83: 8,860 ms/op
Iteration 84: 8,875 ms/op
Iteration 85: 8,913 ms/op
Iteration 86: 8,880 ms/op
Iteration 87: 8,936 ms/op
Iteration 88: 8,867 ms/op
Iteration 89: 8,858 ms/op
Iteration 90: 8,866 ms/op
Iteration 91: 8,912 ms/op
Iteration 92: 8,821 ms/op
Iteration 93: 8,879 ms/op
Iteration 94: 8,859 ms/op
Iteration 95: 8,904 ms/op
Iteration 96: 8,852 ms/op
Iteration 97: 8,856 ms/op
Iteration 98: 8,851 ms/op
Iteration 99: 8,916 ms/op
Iteration 100: 8,841 ms/op
Iteration 101: 8,874 ms/op
Iteration 102: 8,802 ms/op
Iteration 103: 8,864 ms/op
Iteration 104: 8,811 ms/op
Iteration 105: 8,883 ms/op
Iteration 106: 8,824 ms/op
Iteration 107: 8,880 ms/op
Iteration 108: 8,853 ms/op
Iteration 109: 8,869 ms/op
Iteration 110: 8,852 ms/op
Iteration 111: 8,865 ms/op
Iteration 112: 8,872 ms/op
Iteration 113: 8,867 ms/op
Iteration 114: 8,821 ms/op
Iteration 115: 8,851 ms/op
Iteration 116: 8,833 ms/op
Iteration 117: 8,828 ms/op
Iteration 118: 8,873 ms/op
Iteration 119: 8,970 ms/op
Iteration 120: 8,890 ms/op
Result "bench.JavaBench.javaIteratorTest":
8,865 ±(99.9%) 0,011 ms/op [Average]
(min, avg, max) = (8,800, 8,865, 9,030), stdev = 0,036
CI (99.9%): [8,854, 8,876] (assumes normal distribution)
# Run complete. Total time: 00:07:34
REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.
Benchmark Mode Cnt Score Error Units
JavaBench.javaForEach avgt 120 8,839 ± 0,011 ms/op
JavaBench.javaIteratorTest avgt 120 8,865 ± 0,011 ms/op
Benchmark result is saved to /home/wololock/workspace/groovy-jmh/build/reports/jmh/results.txt
BUILD SUCCESSFUL in 25m 18s
6 actionable tasks: 6 executed
18:41:17: Task execution finished 'jmh'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment