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 41.2941.306483042  1% 0% 0% 100%
1.3Pascal Free Pascal #2 3.753.75852785  1% 0% 1% 100%
1.3C gcc 2.492.49856448  0% 1% 0% 100%
1.7C gcc #4 2.672.681,116541  0% 0% 1% 100%
2.1Lua #2 243.95244.011,3721144  0% 0% 0% 100%
2.2C++ g++ #3 2.682.681,452682  0% 1% 4% 100%
2.3Lua #5 2.512.521,460479  0% 1% 1% 100%
2.3Lua #7 5.515.521,464477  0% 1% 0% 100%
2.3Fortran Intel #2 2.742.741,476934  0% 1% 1% 100%
2.3Fortran Intel #3 2.852.861,476975  0% 1% 0% 100%
2.3Lua 4.004.001,508522  0% 1% 0% 100%
2.5Lua #3 2.782.791,596414  0% 1% 1% 100%
2.8Ada 2005 GNAT 3.753.761,7841143  5% 0% 1% 100%
2.8Ada 2005 GNAT #2 2.682.681,7841254  3% 1% 1% 100%
3.0OCaml #4 11.5411.551,9121481  0% 0% 1% 100%
5.1Perl #4 5.235.243,296261  1% 0% 0% 100%
5.2Perl #2 5.945.943,368385  0% 0% 0% 100%
5.5Go #4 7.727.723,540607  1% 1% 0% 100%
5.5Go #2 7.647.653,556674  1% 1% 1% 100%
5.5PHP #4 2.802.803,580384  1% 1% 2% 100%
5.5PHP #5 2.782.783,588394  0% 0% 1% 100%
5.6PHP #3 2.882.883,640500  0% 0% 0% 100%
6.0PHP #2 4.554.563,912537  0% 0% 0% 100%
6.7OCaml #2 17.5317.554,372510  0% 0% 0% 100%
6.9Perl 16.3016.324,488452  0% 0% 0% 100%
6.9Rust 20.4420.464,500691  0% 0% 1% 100%
7.0OCaml #3 13.6013.624,536869  0% 0% 0% 100%
7.5Python 3 13.4513.464,888242  1% 0% 1% 100%
8.2Python 3 #2 3.043.055,312256  1% 0% 0% 100%
8.5Python 3 #3 6.146.155,476521  0% 1% 1% 100%
8.7PHP 9 min9 min5,620736  1% 0% 0% 100%
8.8Haskell GHC #4 2.962.965,676341  0% 1% 0% 100%
8.8OCaml 3.803.815,700560  1% 0% 1% 100%
10Lisp SBCL 2.772.776,4761073  1% 2% 1% 100%
23Erlang HiPE #2 23.2323.2615,100512  0% 0% 0% 100%
28Java  #2 4.124.1318,024938  1% 1% 1% 100%
28Erlang HiPE 24.8224.8518,260559  0% 0% 0% 100%
28Racket #2 3.083.0918,4601122  0% 2% 1% 100%
30C# Mono #3 3.983.9819,6361026  1% 1% 1% 100%
31F# Mono #3 3.963.9719,940903  2% 1% 1% 100%
65Java  #4 7.647.6541,9161808  0% 1% 1% 100%
66Dart 39.2839.3242,468321  1% 1% 1% 100%
66Scala #4 4.524.5242,9521125  1% 0% 1% 100%
69Java  #3 7.517.5244,8521826  1% 1% 1% 100%
70C# Mono #2 59.0659.1445,336856  1% 1% 1% 100%
83F# Mono 76.8876.9953,468513  0% 1% 1% 100%
84Lisp SBCL #2 31.5831.6354,164645  1% 0% 0% 100%
103Clojure #5 6.456.4566,8641944  0% 1% 1% 100%
111Ruby #3 11.1111.1372,224242  0% 1% 1% 100%
112Ruby #4 11.0811.1172,408240  0% 0% 1% 100%
174Racket 27.8927.93112,584453  0% 1% 1% 100%
273Smalltalk VisualWorks #4 27.2827.30177,184652  0% 0% 0% 100%
368Ruby 21.6321.67238,256518  0% 0% 1% 100%
568Java  26.7426.79368,384800  1% 1% 0% 100%
599Clojure #2 30.8530.90388,244571  0% 0% 1% 100%
600Clojure #4 9.689.70388,6121794  1% 0% 1% 100%
601Clojure #3 33.5933.65389,316482  0% 1% 0% 100%
911Ruby #5 3.973.98590,372478  2% 2% 0% 100%
942Ruby JRuby #4 20.8120.86610,700240  0% 1% 1% 100%
954Ruby JRuby #3 20.8620.90618,232242  0% 1% 1% 100%
1,017Ruby JRuby 33.9233.98658,964518  1% 1% 1% 100%
1,696Scala #3 26.2026.251,098,720479  1% 0% 1% 100%
C CINT #4 Failed541
Fortran Intel Bad Output1768
Perl #3 Bad Output301
Ruby #2 Failed653
Scala Failed355
"wrong" (different) algorithm / less comparable programs
 Python 3 #4 Failed  248
1.9Lua #8 0.970.971,204609
2.0Lua #4 135.66135.701,304745
570Scala #2 11.3211.34369,432632
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