Skip to content

Instantly share code, notes, and snippets.

@wololock
Created June 25, 2019 15:47
Show Gist options
  • Save wololock/4062fd3916c3278c27f60b21446fe5bf to your computer and use it in GitHub Desktop.
Save wololock/4062fd3916c3278c27f60b21446fe5bf to your computer and use it in GitHub Desktop.
Groovy Trampoline Closure benchmark results (Groovy 3.0.0-beta-1)
$ ./gradlew clean jmh --no-daemon
> Task :jmhRunBytecodeGenerator
Processing 0 classes from /home/wololock/workspace/groovy-closure-trampoline-example/build/classes/java/jmh with "reflection" generator
Processing 5 classes from /home/wololock/workspace/groovy-closure-trampoline-example/build/classes/groovy/jmh with "reflection" generator
Writing out Java source to /home/wololock/workspace/groovy-closure-trampoline-example/build/jmh-generated-sources and resources to /home/wololock/workspace/groovy-closure-trampoline-example/build/jmh-generated-resources
# Warmup Iteration 1: UTING [13s]
> Task :jmh
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
# VM invoker: /home/wololock/.sdkman/candidates/java/8.0.201-oracle/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 30 s each
# Measurement: 42 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.FactorialBench.a_standard
# Run progress: 0,00% complete, ETA 00:07:12
# Fork: 1 of 1
508,147 ms/op
Iteration 1: 494,993 ms/op
·stack: <delayed till summary>
Iteration 2: 491,200 ms/op
·stack: <delayed till summary>
Iteration 3: 494,095 ms/op
·stack: <delayed till summary>
Iteration 4: 493,060 ms/op
·stack: <delayed till summary>
Iteration 5: 504,606 ms/op
·stack: <delayed till summary>
Iteration 6: 513,262 ms/op
·stack: <delayed till summary>
Iteration 7: 511,456 ms/op
·stack: <delayed till summary>
Iteration 8: 494,784 ms/op
·stack: <delayed till summary>
Iteration 9: 495,586 ms/op
·stack: <delayed till summary>
Iteration 10: 496,374 ms/op
·stack: <delayed till summary>
Iteration 11: 495,439 ms/op
·stack: <delayed till summary>
Iteration 12: 496,563 ms/op
·stack: <delayed till summary>
Iteration 13: 494,180 ms/op
·stack: <delayed till summary>
Iteration 14: 519,907 ms/op
·stack: <delayed till summary>
Iteration 15: 502,327 ms/op
·stack: <delayed till summary>
Iteration 16: 501,195 ms/op
·stack: <delayed till summary>
Iteration 17: 491,689 ms/op
·stack: <delayed till summary>
Iteration 18: 495,453 ms/op
·stack: <delayed till summary>
Iteration 19: 488,590 ms/op
·stack: <delayed till summary>
Iteration 20: 491,013 ms/op
·stack: <delayed till summary>
Iteration 21: 490,334 ms/op
·stack: <delayed till summary>
Iteration 22: 487,702 ms/op
·stack: <delayed till summary>
Iteration 23: 492,282 ms/op
·stack: <delayed till summary>
Iteration 24: 487,171 ms/op
·stack: <delayed till summary>
Iteration 25: 493,090 ms/op
·stack: <delayed till summary>
Iteration 26: 488,493 ms/op
·stack: <delayed till summary>
Iteration 27: 491,120 ms/op
·stack: <delayed till summary>
Iteration 28: 489,336 ms/op
·stack: <delayed till summary>
Iteration 29: 488,819 ms/op
·stack: <delayed till summary>
Iteration 30: 514,480 ms/op
·stack: <delayed till summary>
Iteration 31: 489,564 ms/op
·stack: <delayed till summary>
Iteration 32: 489,947 ms/op
·stack: <delayed till summary>
Iteration 33: 490,157 ms/op
·stack: <delayed till summary>
Iteration 34: 488,559 ms/op
·stack: <delayed till summary>
Iteration 35: 491,322 ms/op
·stack: <delayed till summary>
Iteration 36: 494,513 ms/op
·stack: <delayed till summary>
Iteration 37: 489,589 ms/op
·stack: <delayed till summary>
Iteration 38: 489,062 ms/op
·stack: <delayed till summary>
Iteration 39: 493,552 ms/op
·stack: <delayed till summary>
Iteration 40: 490,828 ms/op
·stack: <delayed till summary>
Iteration 41: 490,728 ms/op
·stack: <delayed till summary>
Iteration 42: 489,680 ms/op
·stack: <delayed till summary>
> Task :jmh
Result "bench.FactorialBench.a_standard":
494,669 ±(99.9%) 4,198 ms/op [Average]
(min, avg, max) = (487,171, 494,669, 519,907), stdev = 7,676
CI (99.9%): [490,471, 498,867] (assumes normal distribution)
Secondary result "bench.FactorialBench.a_standard:·stack":
Stack profiler:
....[Thread state distributions]....................................................................
100,0% RUNNABLE
....[Thread state: RUNNABLE]........................................................................
29,1% 29,1% org.codehaus.groovy.reflection.ParameterTypes.isValidMethod
24,9% 24,9% org.codehaus.groovy.reflection.ParameterTypes.correctArguments
23,5% 23,5% sun.reflect.DelegatingMethodAccessorImpl.invoke
13,8% 13,8% org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.pickClosureMethod
3,5% 3,5% sun.reflect.GeneratedMethodAccessor2.invoke
2,8% 2,8% groovy.lang.MetaClassImpl.invokeMethod
0,7% 0,7% bench.FactorialBench$_a_standard_closure1.doCall
0,4% 0,4% java.math.BigInteger.multiply
0,4% 0,4% java.util.Arrays.copyOf
0,3% 0,3% org.codehaus.groovy.runtime.ArrayUtil.createArray
0,6% 0,6% <other>
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
# VM invoker: /home/wololock/.sdkman/candidates/java/8.0.201-oracle/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 30 s each
# Measurement: 42 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.FactorialBench.a_standard_sc
# Run progress: 16,67% complete, ETA 00:07:34
# Fork: 1 of 1
# Warmup Iteration 1: 375,020 ms/op
Iteration 1: 419,535 ms/opG [2m 14s]
·stack: <delayed till summary>
Iteration 2: 417,622 ms/op
·stack: <delayed till summary>
Iteration 3: 420,088 ms/op
·stack: <delayed till summary>
Iteration 4: 418,922 ms/op
·stack: <delayed till summary>
Iteration 5: 419,481 ms/op
·stack: <delayed till summary>
Iteration 6: 422,217 ms/op
·stack: <delayed till summary>
Iteration 7: 419,176 ms/op
·stack: <delayed till summary>
Iteration 8: 419,724 ms/op
·stack: <delayed till summary>
Iteration 9: 418,426 ms/op
·stack: <delayed till summary>
Iteration 10: 421,015 ms/op
·stack: <delayed till summary>
Iteration 11: 418,410 ms/op
·stack: <delayed till summary>
Iteration 12: 414,050 ms/op
·stack: <delayed till summary>
Iteration 13: 418,943 ms/op
·stack: <delayed till summary>
Iteration 14: 427,996 ms/op
·stack: <delayed till summary>
Iteration 15: 418,780 ms/op
·stack: <delayed till summary>
Iteration 16: 418,961 ms/op
·stack: <delayed till summary>
Iteration 17: 419,244 ms/op
·stack: <delayed till summary>
Iteration 18: 421,392 ms/op
·stack: <delayed till summary>
Iteration 19: 419,244 ms/op
·stack: <delayed till summary>
Iteration 20: 422,916 ms/op
·stack: <delayed till summary>
Iteration 21: 420,976 ms/op
·stack: <delayed till summary>
Iteration 22: 417,914 ms/op
·stack: <delayed till summary>
Iteration 23: 420,923 ms/op
·stack: <delayed till summary>
Iteration 24: 422,729 ms/op
·stack: <delayed till summary>
Iteration 25: 418,284 ms/op
·stack: <delayed till summary>
Iteration 26: 420,079 ms/op
·stack: <delayed till summary>
Iteration 27: 416,119 ms/op
·stack: <delayed till summary>
Iteration 28: 418,363 ms/op
·stack: <delayed till summary>
Iteration 29: 421,516 ms/op
·stack: <delayed till summary>
Iteration 30: 416,904 ms/op
·stack: <delayed till summary>
Iteration 31: 419,816 ms/op
·stack: <delayed till summary>
Iteration 32: 418,955 ms/op
·stack: <delayed till summary>
Iteration 33: 419,768 ms/op
·stack: <delayed till summary>
Iteration 34: 420,744 ms/op
·stack: <delayed till summary>
Iteration 35: 422,619 ms/op
·stack: <delayed till summary>
Iteration 36: 417,882 ms/op
·stack: <delayed till summary>
Iteration 37: 418,672 ms/op
·stack: <delayed till summary>
Iteration 38: 417,036 ms/op
·stack: <delayed till summary>
Iteration 39: 417,790 ms/op
·stack: <delayed till summary>
Iteration 40: 420,669 ms/op
·stack: <delayed till summary>
Iteration 41: 419,763 ms/op
·stack: <delayed till summary>
Iteration 42: 420,341 ms/op
·stack: <delayed till summary>
> Task :jmh
Result "bench.FactorialBench.a_standard_sc":
419,619 ±(99.9%) 1,216 ms/op [Average]
(min, avg, max) = (414,050, 419,619, 427,996), stdev = 2,224
CI (99.9%): [418,403, 420,835] (assumes normal distribution)
Secondary result "bench.FactorialBench.a_standard_sc:·stack":
Stack profiler:
....[Thread state distributions]....................................................................
100,0% RUNNABLE
....[Thread state: RUNNABLE]........................................................................
38,3% 38,3% java.math.BigInteger.multiply
28,7% 28,7% org.codehaus.groovy.reflection.ParameterTypes.isValidMethod
15,8% 15,8% org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.pickClosureMethod
4,8% 4,8% sun.reflect.DelegatingMethodAccessorImpl.invoke
3,7% 3,7% groovy.lang.MetaClassImpl.invokeMethod
3,2% 3,2% org.codehaus.groovy.reflection.ParameterTypes.correctArguments
3,2% 3,2% org.codehaus.groovy.reflection.CachedMethod.invoke
0,6% 0,6% java.math.BigInteger.multiplyByInt
0,3% 0,3% java.util.Arrays.copyOf
0,3% 0,3% bench.FactorialBench.a_standard_sc
1,1% 1,1% <other>
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
# VM invoker: /home/wololock/.sdkman/candidates/java/8.0.201-oracle/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 30 s each
# Measurement: 42 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.FactorialBench.b_trampoline
# Run progress: 33,33% complete, ETA 00:05:48
# Fork: 1 of 1
# Warmup Iteration 1: 1057,120 ms/op
Iteration 1: 1037,946 ms/op [3m 38s]
·stack: <delayed till summary>
Iteration 2: 1043,053 ms/op
·stack: <delayed till summary>
Iteration 3: 1035,708 ms/op
·stack: <delayed till summary>
Iteration 4: 1038,590 ms/op
·stack: <delayed till summary>
Iteration 5: 1055,009 ms/op
·stack: <delayed till summary>
Iteration 6: 1053,208 ms/op
·stack: <delayed till summary>
Iteration 7: 1046,793 ms/op
·stack: <delayed till summary>
Iteration 8: 1049,952 ms/op
·stack: <delayed till summary>
Iteration 9: 1052,108 ms/op
·stack: <delayed till summary>
Iteration 10: 1053,491 ms/op
·stack: <delayed till summary>
Iteration 11: 1059,791 ms/op
·stack: <delayed till summary>
Iteration 12: 1046,414 ms/op
·stack: <delayed till summary>
Iteration 13: 1053,137 ms/op
·stack: <delayed till summary>
Iteration 14: 1043,260 ms/op
·stack: <delayed till summary>
Iteration 15: 1089,942 ms/op
·stack: <delayed till summary>
Iteration 16: 1066,098 ms/op
·stack: <delayed till summary>
Iteration 17: 1051,214 ms/op
·stack: <delayed till summary>
Iteration 18: 1062,612 ms/op
·stack: <delayed till summary>
Iteration 19: 1054,529 ms/op
·stack: <delayed till summary>
Iteration 20: 1053,742 ms/op
·stack: <delayed till summary>
Iteration 21: 1060,634 ms/op
·stack: <delayed till summary>
Iteration 22: 1058,384 ms/op
·stack: <delayed till summary>
Iteration 23: 1050,349 ms/op
·stack: <delayed till summary>
Iteration 24: 1051,340 ms/op
·stack: <delayed till summary>
Iteration 25: 1055,534 ms/op
·stack: <delayed till summary>
Iteration 26: 1050,027 ms/op
·stack: <delayed till summary>
Iteration 27: 1051,420 ms/op
·stack: <delayed till summary>
Iteration 28: 1054,098 ms/op
·stack: <delayed till summary>
Iteration 29: 1058,871 ms/op
·stack: <delayed till summary>
Iteration 30: 1056,883 ms/op
·stack: <delayed till summary>
Iteration 31: 1044,050 ms/op
·stack: <delayed till summary>
Iteration 32: 1052,542 ms/op
·stack: <delayed till summary>
Iteration 33: 1058,171 ms/op
·stack: <delayed till summary>
Iteration 34: 1058,369 ms/op
·stack: <delayed till summary>
Iteration 35: 1055,825 ms/op
·stack: <delayed till summary>
Iteration 36: 1053,988 ms/op
·stack: <delayed till summary>
Iteration 37: 1056,378 ms/op
·stack: <delayed till summary>
Iteration 38: 1046,339 ms/op
·stack: <delayed till summary>
Iteration 39: 1055,263 ms/op
·stack: <delayed till summary>
Iteration 40: 1051,243 ms/op
·stack: <delayed till summary>
Iteration 41: 1044,855 ms/op
·stack: <delayed till summary>
Iteration 42: 1039,557 ms/op
·stack: <delayed till summary>
> Task :jmh
Result "bench.FactorialBench.b_trampoline":
1052,636 ±(99.9%) 4,921 ms/op [Average]
(min, avg, max) = (1035,708, 1052,636, 1089,942), stdev = 8,999
CI (99.9%): [1047,715, 1057,557] (assumes normal distribution)
Secondary result "bench.FactorialBench.b_trampoline:·stack":
Stack profiler:
....[Thread state distributions]....................................................................
100,0% RUNNABLE
....[Thread state: RUNNABLE]........................................................................
22,8% 22,8% org.codehaus.groovy.reflection.ParameterTypes.isValidMethod
21,7% 21,7% org.codehaus.groovy.reflection.ParameterTypes.coerceArgumentsToClasses
15,8% 15,8% org.codehaus.groovy.reflection.ParameterTypes.correctArguments
11,9% 11,9% groovy.lang.Closure.<init>
10,2% 10,2% sun.reflect.DelegatingMethodAccessorImpl.invoke
7,6% 7,6% groovy.lang.TrampolineClosure.<init>
6,3% 6,3% org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.pickClosureMethod
0,7% 0,7% org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke
0,6% 0,6% groovy.lang.MetaMethod.doMethodInvoke
0,3% 0,3% org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap.invoke
2,1% 2,1% <other>
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
# VM invoker: /home/wololock/.sdkman/candidates/java/8.0.201-oracle/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 30 s each
# Measurement: 42 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.FactorialBench.b_trampoline_sc
# Run progress: 50,00% complete, ETA 00:04:09
# Fork: 1 of 1
# Warmup Iteration 1: 697,800 ms/op
Iteration 1: 695,632 ms/opG [4m 53s]
·stack: <delayed till summary>
Iteration 2: 698,790 ms/op
·stack: <delayed till summary>
Iteration 3: 695,804 ms/op
·stack: <delayed till summary>
Iteration 4: 697,169 ms/op
·stack: <delayed till summary>
Iteration 5: 702,002 ms/op
·stack: <delayed till summary>
Iteration 6: 695,966 ms/op
·stack: <delayed till summary>
Iteration 7: 692,856 ms/op
·stack: <delayed till summary>
Iteration 8: 699,023 ms/op
·stack: <delayed till summary>
Iteration 9: 685,782 ms/op
·stack: <delayed till summary>
Iteration 10: 695,114 ms/op
·stack: <delayed till summary>
Iteration 11: 696,918 ms/op
·stack: <delayed till summary>
Iteration 12: 696,239 ms/op
·stack: <delayed till summary>
Iteration 13: 696,068 ms/op
·stack: <delayed till summary>
Iteration 14: 696,340 ms/op
·stack: <delayed till summary>
Iteration 15: 700,242 ms/op
·stack: <delayed till summary>
Iteration 16: 701,298 ms/op
·stack: <delayed till summary>
Iteration 17: 700,877 ms/op
·stack: <delayed till summary>
Iteration 18: 702,103 ms/op
·stack: <delayed till summary>
Iteration 19: 701,883 ms/op
·stack: <delayed till summary>
Iteration 20: 701,029 ms/op
·stack: <delayed till summary>
Iteration 21: 704,905 ms/op
·stack: <delayed till summary>
Iteration 22: 697,353 ms/op
·stack: <delayed till summary>
Iteration 23: 695,725 ms/op
·stack: <delayed till summary>
Iteration 24: 702,099 ms/op
·stack: <delayed till summary>
Iteration 25: 699,883 ms/op
·stack: <delayed till summary>
Iteration 26: 696,232 ms/op
·stack: <delayed till summary>
Iteration 27: 699,391 ms/op
·stack: <delayed till summary>
Iteration 28: 700,271 ms/op
·stack: <delayed till summary>
Iteration 29: 695,822 ms/op
·stack: <delayed till summary>
Iteration 30: 697,130 ms/op
·stack: <delayed till summary>
Iteration 31: 699,894 ms/op
·stack: <delayed till summary>
Iteration 32: 700,994 ms/op
·stack: <delayed till summary>
Iteration 33: 698,088 ms/op
·stack: <delayed till summary>
Iteration 34: 698,709 ms/op
·stack: <delayed till summary>
Iteration 35: 698,381 ms/op
·stack: <delayed till summary>
Iteration 36: 703,184 ms/op
·stack: <delayed till summary>
Iteration 37: 696,458 ms/op
·stack: <delayed till summary>
Iteration 38: 700,077 ms/op
·stack: <delayed till summary>
Iteration 39: 698,059 ms/op
·stack: <delayed till summary>
Iteration 40: 698,388 ms/op
·stack: <delayed till summary>
Iteration 41: 702,002 ms/op
·stack: <delayed till summary>
Iteration 42: 705,676 ms/op
·stack: <delayed till summary>
> Task :jmh
Result "bench.FactorialBench.b_trampoline_sc":
698,568 ±(99.9%) 1,892 ms/op [Average]
(min, avg, max) = (685,782, 698,568, 705,676), stdev = 3,459
CI (99.9%): [696,676, 700,460] (assumes normal distribution)
Secondary result "bench.FactorialBench.b_trampoline_sc:·stack":
Stack profiler:
....[Thread state distributions]....................................................................
100,0% RUNNABLE
....[Thread state: RUNNABLE]........................................................................
29,6% 29,6% org.codehaus.groovy.reflection.ParameterTypes.isValidMethod
24,5% 24,5% java.math.BigInteger.multiply
15,5% 15,5% groovy.lang.Closure.<init>
10,6% 10,6% groovy.lang.TrampolineClosure.<init>
9,5% 9,5% org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.pickClosureMethod
5,2% 5,2% org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.getMethods
2,1% 2,1% org.codehaus.groovy.reflection.ParameterTypes.correctArguments
0,9% 0,9% sun.reflect.DelegatingMethodAccessorImpl.invoke
0,4% 0,4% groovy.lang.MetaClassImpl.invokeMethod
0,2% 0,2% java.math.BigInteger.multiplyByInt
1,6% 1,6% <other>
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
# VM invoker: /home/wololock/.sdkman/candidates/java/8.0.201-oracle/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 30 s each
# Measurement: 42 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.FactorialBench.c_tailRecursive
# Run progress: 66,67% complete, ETA 00:02:49
# Fork: 1 of 1
# Warmup Iteration 1: 320,059 ms/op
Iteration 1: 317,454 ms/opG [6m 22s]
·stack: <delayed till summary>
Iteration 2: 315,671 ms/op
·stack: <delayed till summary>
Iteration 3: 318,006 ms/op
·stack: <delayed till summary>
Iteration 4: 316,070 ms/op
·stack: <delayed till summary>
Iteration 5: 318,330 ms/op
·stack: <delayed till summary>
Iteration 6: 313,573 ms/op
·stack: <delayed till summary>
Iteration 7: 317,726 ms/op
·stack: <delayed till summary>
Iteration 8: 317,781 ms/op
·stack: <delayed till summary>
Iteration 9: 314,670 ms/op
·stack: <delayed till summary>
Iteration 10: 316,857 ms/op
·stack: <delayed till summary>
Iteration 11: 314,618 ms/op
·stack: <delayed till summary>
Iteration 12: 311,991 ms/op
·stack: <delayed till summary>
Iteration 13: 316,335 ms/op
·stack: <delayed till summary>
Iteration 14: 314,132 ms/op
·stack: <delayed till summary>
Iteration 15: 316,277 ms/op
·stack: <delayed till summary>
Iteration 16: 318,080 ms/op
·stack: <delayed till summary>
Iteration 17: 313,234 ms/op
·stack: <delayed till summary>
Iteration 18: 315,297 ms/op
·stack: <delayed till summary>
Iteration 19: 313,402 ms/op
·stack: <delayed till summary>
Iteration 20: 318,048 ms/op
·stack: <delayed till summary>
Iteration 21: 314,964 ms/op
·stack: <delayed till summary>
Iteration 22: 318,628 ms/op
·stack: <delayed till summary>
Iteration 23: 313,855 ms/op
·stack: <delayed till summary>
Iteration 24: 315,654 ms/op
·stack: <delayed till summary>
Iteration 25: 317,187 ms/op
·stack: <delayed till summary>
Iteration 26: 313,390 ms/op
·stack: <delayed till summary>
Iteration 27: 314,557 ms/op
·stack: <delayed till summary>
Iteration 28: 316,084 ms/op
·stack: <delayed till summary>
Iteration 29: 316,585 ms/op
·stack: <delayed till summary>
Iteration 30: 314,774 ms/op
·stack: <delayed till summary>
Iteration 31: 313,583 ms/op
·stack: <delayed till summary>
Iteration 32: 314,196 ms/op
·stack: <delayed till summary>
Iteration 33: 314,433 ms/op
·stack: <delayed till summary>
Iteration 34: 316,289 ms/op
·stack: <delayed till summary>
Iteration 35: 317,111 ms/op
·stack: <delayed till summary>
Iteration 36: 315,408 ms/op
·stack: <delayed till summary>
Iteration 37: 315,365 ms/op
·stack: <delayed till summary>
Iteration 38: 318,435 ms/op
·stack: <delayed till summary>
Iteration 39: 317,020 ms/op
·stack: <delayed till summary>
Iteration 40: 315,872 ms/op
·stack: <delayed till summary>
Iteration 41: 312,361 ms/op
·stack: <delayed till summary>
Iteration 42: 316,331 ms/op
·stack: <delayed till summary>
> Task :jmh
Result "bench.FactorialBench.c_tailRecursive":
315,706 ±(99.9%) 0,960 ms/op [Average]
(min, avg, max) = (311,991, 315,706, 318,628), stdev = 1,756
CI (99.9%): [314,745, 316,666] (assumes normal distribution)
Secondary result "bench.FactorialBench.c_tailRecursive:·stack":
Stack profiler:
....[Thread state distributions]....................................................................
100,0% RUNNABLE
....[Thread state: RUNNABLE]........................................................................
71,2% 71,2% java.math.BigInteger.<init>
27,0% 27,0% java.math.BigInteger.multiply
0,6% 0,6% bench.FactorialBench.factorialTailRecursive
0,4% 0,4% java.math.BigInteger.multiplyByInt
0,2% 0,2% java.lang.Integer.toString
0,2% 0,2% org.codehaus.groovy.runtime.typehandling.NumberMath.toBigInteger
0,1% 0,1% java.util.Arrays.copyOfRange
0,1% 0,1% sun.misc.Unsafe.unpark
0,0% 0,0% bench.FactorialBench.c_tailRecursive
0,0% 0,0% java.math.BigInteger.shiftLeft
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
# VM invoker: /home/wololock/.sdkman/candidates/java/8.0.201-oracle/jre/bin/java
# VM options: <none>
# Warmup: 1 iterations, 30 s each
# Measurement: 42 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: bench.FactorialBench.c_tailRecursive_sc
# Run progress: 83,33% complete, ETA 00:01:24
# Fork: 1 of 1
# Warmup Iteration 1: 101,718 ms/op
Iteration 1: 101,141 ms/opG [7m 46s]
·stack: <delayed till summary>
Iteration 2: 101,804 ms/op
·stack: <delayed till summary>
Iteration 3: 100,621 ms/op
·stack: <delayed till summary>
Iteration 4: 99,319 ms/op
·stack: <delayed till summary>
Iteration 5: 100,287 ms/op
·stack: <delayed till summary>
Iteration 6: 100,924 ms/op
·stack: <delayed till summary>
Iteration 7: 100,922 ms/op
·stack: <delayed till summary>
Iteration 8: 100,777 ms/op
·stack: <delayed till summary>
Iteration 9: 100,859 ms/op
·stack: <delayed till summary>
Iteration 10: 100,664 ms/op
·stack: <delayed till summary>
Iteration 11: 100,286 ms/op
·stack: <delayed till summary>
Iteration 12: 101,519 ms/op
·stack: <delayed till summary>
Iteration 13: 100,303 ms/op
·stack: <delayed till summary>
Iteration 14: 104,739 ms/op
·stack: <delayed till summary>
Iteration 15: 99,350 ms/op
·stack: <delayed till summary>
Iteration 16: 98,624 ms/op
·stack: <delayed till summary>
Iteration 17: 98,300 ms/op
·stack: <delayed till summary>
Iteration 18: 98,723 ms/op
·stack: <delayed till summary>
Iteration 19: 99,507 ms/op
·stack: <delayed till summary>
Iteration 20: 100,551 ms/op
·stack: <delayed till summary>
Iteration 21: 100,791 ms/op
·stack: <delayed till summary>
Iteration 22: 101,307 ms/op
·stack: <delayed till summary>
Iteration 23: 100,137 ms/op
·stack: <delayed till summary>
Iteration 24: 101,802 ms/op
·stack: <delayed till summary>
Iteration 25: 100,416 ms/op
·stack: <delayed till summary>
Iteration 26: 101,276 ms/op
·stack: <delayed till summary>
Iteration 27: 100,806 ms/op
·stack: <delayed till summary>
Iteration 28: 101,153 ms/op
·stack: <delayed till summary>
Iteration 29: 100,878 ms/op
·stack: <delayed till summary>
Iteration 30: 99,483 ms/op
·stack: <delayed till summary>
Iteration 31: 100,892 ms/op
·stack: <delayed till summary>
Iteration 32: 101,169 ms/op
·stack: <delayed till summary>
Iteration 33: 100,875 ms/op
·stack: <delayed till summary>
Iteration 34: 100,854 ms/op
·stack: <delayed till summary>
Iteration 35: 100,661 ms/op
·stack: <delayed till summary>
Iteration 36: 100,854 ms/op
·stack: <delayed till summary>
Iteration 37: 100,575 ms/op
·stack: <delayed till summary>
Iteration 38: 101,331 ms/op
·stack: <delayed till summary>
Iteration 39: 101,200 ms/op
·stack: <delayed till summary>
Iteration 40: 101,053 ms/op
·stack: <delayed till summary>
Iteration 41: 99,619 ms/op
·stack: <delayed till summary>
Iteration 42: 100,251 ms/op
·stack: <delayed till summary>
> Task :jmh
Result "bench.FactorialBench.c_tailRecursive_sc":
100,633 ±(99.9%) 0,570 ms/op [Average]
(min, avg, max) = (98,300, 100,633, 104,739), stdev = 1,042
CI (99.9%): [100,063, 101,203] (assumes normal distribution)
Secondary result "bench.FactorialBench.c_tailRecursive_sc:·stack":
Stack profiler:
....[Thread state distributions]....................................................................
100,0% RUNNABLE
....[Thread state: RUNNABLE]........................................................................
97,6% 97,6% java.math.BigInteger.multiply
0,9% 0,9% java.math.BigInteger.multiplyByInt
0,4% 0,4% java.util.Arrays.copyOfRange
0,4% 0,4% bench.FactorialBench.factorialTailRecursiveSC
0,3% 0,3% java.math.BigInteger.valueOf
0,1% 0,1% sun.misc.Unsafe.unpark
0,1% 0,1% java.math.BigInteger.<init>
0,0% 0,0% bench.FactorialBench.c_tailRecursive_sc
0,0% 0,0% java.math.BigInteger.shiftLeft
0,0% 0,0% bench.generated.FactorialBench_c_tailRecursive_sc_jmhTest.c_tailRecursive_sc_avgt_jmhStub
0,1% 0,1% <other>
# Run complete. Total time: 00:08:16
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
FactorialBench.a_standard avgt 42 494,669 ± 4,198 ms/op
FactorialBench.a_standard:·stack avgt NaN ---
FactorialBench.a_standard_sc avgt 42 419,619 ± 1,216 ms/op
FactorialBench.a_standard_sc:·stack avgt NaN ---
FactorialBench.b_trampoline avgt 42 1052,636 ± 4,921 ms/op
FactorialBench.b_trampoline:·stack avgt NaN ---
FactorialBench.b_trampoline_sc avgt 42 698,568 ± 1,892 ms/op
FactorialBench.b_trampoline_sc:·stack avgt NaN ---
FactorialBench.c_tailRecursive avgt 42 315,706 ± 0,960 ms/op
FactorialBench.c_tailRecursive:·stack avgt NaN ---
FactorialBench.c_tailRecursive_sc avgt 42 100,633 ± 0,570 ms/op
FactorialBench.c_tailRecursive_sc:·stack avgt NaN ---
Benchmark result is saved to /home/wololock/workspace/groovy-closure-trampoline-example/build/reports/jmh/results.txt
BUILD SUCCESSFUL in 8m 30s
6 actionable tasks: 6 executed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment