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.3Pascal Free Pascal #2 2.792.791,040785  2% 1% 1% 100%
1.5Pascal Free Pascal #3 1.721.731,192482  0% 2% 0% 100%
1.9Fortran Intel #2 2.292.291,592934  1% 1% 1% 100%
1.9Fortran Intel #3 1.911.911,592975  0% 1% 1% 99%
2.5C gcc 1.721.732,072448  1% 1% 0% 100%
2.8C gcc #4 2.282.292,272541  1% 0% 1% 100%
4.2C++ g++ #3 2.282.293,460682  1% 0% 3% 100%
4.4Go #2 4.064.063,612674  0% 1% 0% 100%
4.4Go #4 4.184.183,624607  0% 0% 1% 100%
5.0PHP #4 2.242.244,096384  0% 1% 2% 100%
5.0PHP #5 2.232.234,100394  1% 0% 0% 100%
5.0Ada 2005 GNAT #2 2.282.294,1321254  0% 1% 1% 100%
5.0PHP #3 2.312.324,140500  1% 0% 0% 100%
5.1Perl #3 3.453.464,160301  0% 1% 0% 100%
5.1Perl #4 3.373.384,184261  0% 1% 2% 100%
5.2Perl #2 3.853.864,232385  1% 1% 1% 100%
5.4Ada 2005 GNAT 10.9810.984,4001143  0% 1% 0% 100%
5.4PHP #2 3.403.404,460537  1% 1% 1% 100%
7.3Haskell GHC #4 2.222.225,948341  0% 1% 1% 100%
7.6Perl 14.7814.786,264452  1% 0% 1% 100%
7.7PHP 9 min9 min6,304736  1% 1% 1% 100%
8.2Python 3 #2 2.412.416,696256  0% 1% 1% 100%
8.3Rust 1.731.736,7881420  0% 0% 1% 100%
8.3Python 3 #5 2.192.196,808335  1% 1% 0% 100%
10OCaml 2.832.838,472560  1% 0% 0% 100%
11Lisp SBCL 2.362.369,2801073  1% 1% 0% 100%
28Erlang HiPE #2 16.2016.2223,228512  1% 1% 0% 100%
32Erlang HiPE 17.6717.6926,252559  1% 1% 0% 100%
37Racket #2 2.322.3230,6241122  1% 0% 0% 100%
40Java  #2 3.203.2033,052938  1% 1% 1% 100%
50C# Mono #3 11.2211.2241,1001026  0% 0% 1% 100%
52F# Mono #3 11.1911.2042,380903  1% 1% 0% 100%
53Dart 11.2811.3043,740321  2% 1% 1% 100%
64Smalltalk VisualWorks #4 11.5811.5852,888652  0% 1% 1% 100%
76Scala #4 3.463.4662,3721125  1% 1% 1% 100%
80C# Mono #2 38.5238.5965,948856  1% 1% 0% 100%
84Java  #4 6.596.6068,9001808  0% 1% 1% 100%
88Java  #3 6.506.5072,4521826  0% 1% 1% 100%
95F# Mono 40.5640.6377,536513  1% 1% 0% 100%
112Clojure #5 5.405.4091,9281944  1% 1% 0% 100%
146Racket 23.2923.33119,404453  0% 1% 1% 100%
147Lisp SBCL #2 21.7021.74120,540645  0% 1% 1% 100%
158Hack 8 min8 min129,576735  1% 1% 1% 100%
180Ruby #3 11.2011.22147,884242  0% 1% 1% 100%
183Ruby #4 11.2111.23149,764240  0% 1% 1% 100%
197Ruby 30.2930.35161,248518  0% 0% 1% 100%
466Java  18.1618.20381,788800  0% 1% 1% 100%
466Scala #3 15.2215.26382,216479  2% 2% 1% 100%
506Clojure #4 8.128.13414,9241794  1% 0% 0% 100%
509Clojure #2 21.5621.59417,684571  0% 1% 1% 100%
515Clojure #3 25.4425.48421,960482  1% 1% 1% 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%
Fortran Intel Failed1768
Lua Failed522
Lua #7 Failed477
Lua #3 Failed414
Lua #2 Failed1144
Lua #5 Failed479
OCaml #2 Make Error510
OCaml #4 Make Error1481
OCaml #3 Make Error869
Ruby #2 Failed653
Ruby #5 Failed478
Scala Failed355
"wrong" (different) algorithm / less comparable programs
 Python 3 #4 Failed  248
 Lua #4 Failed  745
 Lua #8 Failed  609
498Scala #2 9.229.23408,092632
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