/mobile Handheld Friendly website

 pidigits benchmark N=10,000

Each chart bar shows how many times slower, one ↓ pidigits program was, compared to the fastest program.

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.

     sortsortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0C gcc 2.492.50860448  0% 0% 1% 100%
1.0Lua #5 2.512.521,460479  0% 1% 1% 100%
1.1C++ g++ #3 2.682.681,452682  0% 0% 1% 100%
1.1Ada 2005 GNAT #2 2.682.681,8041254  0% 1% 0% 100%
1.1C gcc #4 2.682.681,128541  0% 1% 0% 100%
1.1ATS #2 2.732.73860942  0% 1% 0% 100%
1.1ATS #3 2.742.741,1241154  0% 0% 0% 100%
1.1Fortran Intel #2 2.742.741,476934  0% 1% 1% 100%
1.1Lisp SBCL 2.762.774,8761073  0% 1% 0% 100%
1.1Lua #3 2.782.791,596414  0% 1% 1% 100%
1.1PHP #4 2.792.803,536384  1% 0% 0% 100%
1.1Fortran Intel #3 2.852.861,476975  0% 1% 0% 100%
1.2PHP #3 2.882.883,580500  1% 0% 0% 100%
1.2Python 3 #2 3.063.065,408255  1% 0% 1% 100%
1.2Racket #2 3.063.0618,0281122  0% 1% 1% 100%
1.2Haskell GHC #4 3.063.075,284341  0% 1% 1% 100%
1.5Pascal Free Pascal #2 3.763.76856785  1% 2% 0% 100%
1.5Ada 2005 GNAT 3.763.761,8041143  0% 0% 0% 100%
1.5OCaml 3.803.815,704560  1% 1% 0% 100%
1.6C# Mono #3 3.963.9614,7761026  1% 1% 0% 100%
1.6F# Mono #3 3.963.9715,220903  1% 1% 0% 100%
1.6Lua 4.004.001,508522  0% 1% 0% 100%
1.7ATS 4.234.231,020671  0% 0% 0% 100%
1.8Scala #4 4.444.4544,0441125  0% 0% 0% 100%
1.8PHP #2 4.564.563,864537  1% 0% 0% 100%
2.1Perl #4 5.235.243,296261  1% 0% 0% 100%
2.2Lua #7 5.515.521,464477  0% 1% 0% 100%
2.4Perl #2 5.945.943,368385  0% 0% 0% 100%
2.5Python 3 #3 6.186.185,588520  1% 0% 0% 100%
2.9Java 7  #3 7.337.3447,4401826  0% 0% 0% 100%
3.0Java 7  #4 7.387.3947,6161808  0% 0% 0% 100%
3.0Go #4 7.437.444,224607  0% 0% 0% 100%
3.8Ruby 2.0 #2 9.439.452,008,452653  0% 0% 0% 100%
4.6OCaml #4 11.5611.571,9121481  0% 0% 0% 100%
5.0OCaml #3 12.5312.544,536869  0% 0% 0% 100%
5.4Python 3 13.3813.395,232242  0% 0% 0% 100%
6.5OCaml #2 16.1116.124,348510  0% 0% 0% 100%
6.5Perl 16.3016.324,488452  0% 0% 0% 100%
7.8Ruby 2.0 #3 19.3219.3513,196242  1% 0% 0% 100%
9.3Scala #3 23.1523.19439,212479  0% 0% 0% 100%
9.3Erlang HiPE #2 23.2323.2615,100512  0% 0% 0% 100%
10Erlang HiPE 24.8224.8518,260559  0% 0% 0% 100%
10Ruby JRuby #3 25.5325.58581,996242  0% 0% 0% 100%
11Java 7  26.7326.77231,676800  0% 0% 0% 100%
11Smalltalk VisualWorks #4 27.2827.30177,184652  0% 0% 0% 100%
12Racket 28.7328.78110,924453  0% 0% 0% 100%
13Dart 31.6131.6638,944359  0% 1% 0% 100%
13Lisp SBCL #2 32.6732.7350,184645  0% 0% 0% 100%
16Ruby 2.0 41.0041.0614,824518  0% 0% 0% 100%
17Pascal Free Pascal 41.3641.376483042  0% 0% 0% 100%
18Clojure #2 44.7044.7583,748571  0% 0% 0% 100%
19Clojure #3 47.2847.3497,564482  0% 0% 0% 100%
20Ruby JRuby 51.0351.11590,304518  0% 0% 0% 100%
23C# Mono #2 57.3957.4116,896856  0% 0% 0% 100%
30F# Mono 75.0575.0821,176513  1% 0% 0% 100%
98Lua #2 243.95244.011,3721144  0% 0% 0% 100%
224PHP 9 min9 min5,324736  0% 0% 0% 100%
C CINT #4 Failed541
Fortran Intel Bad Output1768
Java 7  #2 Failed938
Perl #3 Bad Output301
"wrong" (different) algorithm / less comparable programs
0.0Python 3 #4 0.060.06?246
0.4Lua #8 0.970.971,204609
4.8Scala #2 11.9211.94419,364632
54Lua #4 135.66135.701,304745
missing benchmark programs
JavaScript V8 No program

 pidigits benchmark : Streaming arbitrary-precision arithmetic

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