Skip to content

Instantly share code, notes, and snippets.

@melix

melix/Fibonenchmark

Last active Aug 29, 2015
Embed
What would you like to do?
Fibonacci Benchmark
# Run complete. Total time: 00:34:14
Benchmark Mode Samples Score Error Units
o.g.m.f.FibonacciMicroBenchmark.groovy_primitive_cs avgt 30 1.961 ± 0.055 ms/op
o.g.m.f.FibonacciMicroBenchmark.baseline_java_30 avgt 30 2.004 ± 0.084 ms/op
o.g.m.f.FibonacciMicroBenchmark.baseline_java_boxing_30 avgt 30 5.504 ± 0.036 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_primitive_30 avgt 30 5.733 ± 0.024 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_indy_30 avgt 30 5.903 ± 0.033 ms/op
o.g.m.f.FibonacciMicroBenchmark.golo_30 avgt 30 6.545 ± 0.060 ms/op
o.g.m.f.FibonacciMicroBenchmark.nashorn_30 avgt 30 7.812 ± 0.061 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_indy_primitive_30 avgt 30 8.033 ± 0.130 ms/op
o.g.m.f.FibonacciMicroBenchmark.clojure_30 avgt 30 9.277 ± 0.161 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_30 avgt 30 23.930 ± 0.228 ms/op
o.g.m.f.FibonacciMicroBenchmark.jruby_30 avgt 30 25.868 ± 0.663 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_primitive_cs_40 avgt 30 238.734 ± 0.994 ms/op
o.g.m.f.FibonacciMicroBenchmark.baseline_java_40 avgt 30 238.913 ± 2.652 ms/op
o.g.m.f.FibonacciMicroBenchmark.baseline_java_boxing_40 avgt 30 703.751 ± 15.198 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_primitive_40 avgt 30 710.078 ± 6.669 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_indy_40 avgt 30 726.623 ± 7.280 ms/op
o.g.m.f.FibonacciMicroBenchmark.golo_40 avgt 30 800.427 ± 10.386 ms/op
o.g.m.f.FibonacciMicroBenchmark.nashorn_40 avgt 30 961.904 ± 10.431 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_indy_primitive_40 avgt 30 992.273 ± 23.452 ms/op
o.g.m.f.FibonacciMicroBenchmark.clojure_40 avgt 30 1131.375 ± 7.095 ms/op
o.g.m.f.FibonacciMicroBenchmark.groovy_40 avgt 30 2937.296 ± 21.417 ms/op
o.g.m.f.FibonacciMicroBenchmark.jruby_40 avgt 30 3153.625 ± 46.717 ms/op
@melix

This comment has been minimized.

Copy link
Owner Author

@melix melix commented Dec 2, 2014

The numbers above are comparing the performance of the infamous Fibonacci benchmark for various dynamic languages. It computes fib(30) or fib(40).

Tests done with Groovy 2.4.0-SNAPSHOT (results may be updated).

VM:

java version "1.8.0_40-ea"
Java(TM) SE Runtime Environment (build 1.8.0_40-ea-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b18, mixed mode)

Why so many Groovy versions of the benchmark ? Basically we tested:

  • untyped Groovy: fib(n)
  • typed Groovy: long fib(long n)
  • invokedynamic versions of the above (_indy, Groovy has 2 runtimes: legacy and indy)
  • statically compiled Groovy (_cs, using @CompileStatic)

see melix/golo-lang@a2148dc

@eugene-kamenev

This comment has been minimized.

Copy link

@eugene-kamenev eugene-kamenev commented Dec 10, 2014

Thanks, but what a thing happen with groovy indy results?

@chensb

This comment has been minimized.

Copy link

@chensb chensb commented Mar 5, 2015

why groovy_indy_primitive is much slower than groovy_primitive_40 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.