pidigits benchmark N=10,000

Each chart bar shows how many times more Memory, one ↓ pidigits program used, compared to the program that used least Memory.

These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.

Column × shows how many times more each program used compared to the benchmark program that used least.

    sortsort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0Pascal Free Pascal 29.4429.458203042  1% 1% 0% 100%
1.1C gcc #4 2.292.29928541  2% 1% 0% 100%
1.1C gcc 1.731.73932448  0% 1% 1% 100%
1.3Pascal Free Pascal #2 2.792.791,040785  2% 1% 1% 100%
1.6Fortran Intel #2 2.292.291,324934  3% 0% 0% 100%
1.6Fortran Intel #3 1.911.911,324975  0% 3% 0% 100%
2.0C++ g++ #3 2.292.301,656682  0% 1% 2% 100%
2.0Lua #3 2.332.341,672414  0% 0% 0% 100%
2.0Lua #7 3.703.711,680477  0% 0% 0% 100%
2.1Lua 2.942.951,748522  0% 0% 1% 100%
2.4Lua #5 1.931.941,932479  0% 1% 1% 100%
2.5Ada 2005 GNAT #2 2.292.302,0721254  0% 1% 1% 100%
2.7Lua #2 217.52217.582,2161144  0% 0% 0% 100%
2.8Ada 2005 GNAT 10.8510.862,3321143  1% 0% 1% 100%
3.5OCaml #4 9.309.312,8321481  0% 0% 0% 100%
4.4Go #2 4.064.063,612674  0% 1% 0% 100%
4.4Go #4 4.184.183,624607  0% 0% 1% 100%
4.9Perl #3 4.374.374,052301  0% 0% 0% 100%
5.0Perl #2 4.774.784,092385  0% 0% 0% 100%
5.0Perl #4 4.294.304,100261  0% 0% 0% 100%
5.2PHP #5 2.152.154,284394  0% 0% 0% 100%
5.2PHP #4 2.162.174,284384  0% 0% 0% 100%
5.3PHP #3 2.242.254,328500  0% 1% 0% 100%
5.8Rust 14.4514.464,748691  1% 0% 0% 100%
5.9PHP #2 3.383.384,800537  0% 0% 0% 100%
6.5Rust #2 1.731.735,3081297  0% 3% 0% 100%
7.3Haskell GHC #4 2.242.245,964341  1% 0% 1% 100%
7.4Perl 15.2515.266,100452  0% 0% 0% 100%
7.5Python 3 6.146.146,112242  1% 0% 0% 100%
7.8PHP 8 min8 min6,392736  0% 0% 0% 100%
8.1Python 3 #2 2.392.396,612256  2% 0% 1% 100%
8.3Python 3 #3 4.534.536,796521  0% 1% 0% 100%
9.5OCaml #3 16.2016.237,752869  0% 0% 0% 100%
9.5OCaml #2 19.9019.947,764510  0% 0% 0% 100%
11OCaml 2.802.819,036560  0% 1% 1% 100%
13Lisp SBCL 2.362.3611,0281073  1% 0% 1% 100%
25C# Mono #3 11.0211.0220,3001026  1% 1% 2% 100%
25F# Mono #3 11.0011.0120,736903  1% 1% 0% 100%
30Erlang HiPE #2 15.9415.9624,856512  0% 1% 1% 100%
31Erlang HiPE 17.5217.5425,364559  1% 1% 0% 100%
31Racket #2 2.342.3425,6201122  0% 1% 1% 100%
35Java  #2 3.153.1528,972938  1% 0% 2% 100%
41Dart 26.3426.3633,484321  1% 0% 1% 100%
53Smalltalk VisualWorks #4 11.2511.2743,644652  0% 0% 0% 100%
60C# Mono #2 39.8239.8949,084856  0% 1% 0% 100%
67Scala #4 3.513.5255,1241125  1% 0% 1% 100%
71Java  #4 6.186.1858,4321808  1% 1% 1% 100%
77Java  #3 6.096.1062,8841826  0% 0% 1% 100%
93Ruby #3 10.9610.9876,344242  1% 1% 0% 100%
94Ruby #4 10.9310.9576,836240  0% 1% 1% 100%
101Hack 7 min7 min82,812735  1% 1% 0% 100%
101Clojure #5 5.265.2782,8441944  0% 1% 0% 100%
127Ruby 29.8729.93104,120518  1% 0% 1% 100%
141Lisp SBCL #2 21.4021.44115,440645  0% 1% 1% 100%
147Racket 27.8127.85120,304453  1% 0% 1% 100%
453Scala #3 14.9715.00371,680479  1% 1% 0% 100%
463Java  18.3418.37379,564800  0% 0% 1% 100%
498Clojure #4 8.278.28408,2241794  1% 1% 1% 100%
500Clojure #2 22.1322.17409,688571  1% 1% 1% 100%
504Clojure #3 24.8824.93413,112482  1% 0% 0% 100%
805Ruby JRuby #4 17.3817.41660,360240  1% 0% 1% 100%
821Ruby JRuby #3 18.0118.05672,876242  1% 1% 0% 100%
911Ruby JRuby 27.7027.75746,984518  1% 0% 1% 100%
F# Mono Failed513
Fortran Intel Failed1768
Ruby #2 Failed653
Ruby #5 Failed478
Scala Failed355
"wrong" (different) algorithm / less comparable programs
 Python 3 #4 Failed  248
1.7Lua #8 0.580.591,424609
2.2Lua #4 113.36113.391,816745
454Scala #2 7.998.01372,464632
missing benchmark programs
JavaScript V8 No program

 pidigits benchmark : Streaming arbitrary-precision arithmetic

You can write your own program for this task and contribute to the benchmarks game by following these general instructions.

More specifically:

diff program output N = 27 with this output file to check your program is correct before contributing.

We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.

Each program should use the same step-by-step spigot algorithm to calculate digits of Pi.

Each program should

Programs should adapt the step-by-step algorithm given on pages 4,6 & 7 of Unbounded Spigot Algorithms for the Digits of Pi (156KB pdf). (Not the deliberately obscure version given on page 2.)(Not the Rabinowitz-Wagon algorithm.)

In addition to language specific multiprecision arithmetic, we will accept programs that use GMP.

For more information see Eric W. Weisstein, "Pi Digits." From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/PiDigits.html

Revised BSD license

  Home   Conclusions   License   Play