The Computer Language
Benchmarks Game

pidigits

program source code, command-line and measurements

× source code secs KB gz cpu cpu load
1.0 C gcc 1.73 1,988 448 1.72 1% 0% 1% 100%
1.0 Pascal Free Pascal #3 1.73 2,300 482 1.72 2% 0% 1% 100%
1.0 Rust 1.73 7,092 1420 1.73 99% 1% 1% 1%
1.1 Fortran Intel #3 1.92 1,572 975 1.91 0% 2% 100% 3%
1.1 Lua #5 1.94 3,156 479 1.94 1% 100% 1% 1%
1.3 PHP #5 2.18 8,780 394 2.18 0% 3% 100% 0%
1.3 PHP #4 2.19 8,876 384 2.18 100% 0% 0% 0%
1.3 Python 3 #5 2.20 10,248 335 2.20 1% 0% 0% 100%
1.3 PHP #3 2.21 8,908 500 2.20 2% 1% 0% 100%
1.3 Ada 2005 GNAT #2 2.29 4,184 1254 2.28 100% 1% 1% 0%
1.3 C gcc #4 2.29 2,244 541 2.29 1% 100% 0% 2%
1.3 C++ g++ #3 2.29 3,792 682 2.29 1% 100% 1% 1%
1.3 Fortran Intel #2 2.30 1,596 934 2.30 1% 1% 100% 1%
1.3 Racket #2 2.31 34,644 1122 2.31 100% 2% 0% 1%
1.4 Lua #3 2.34 3,092 414 2.34 0% 1% 1% 100%
1.4 Lisp SBCL 2.37 20,784 1073 2.37 1% 0% 0% 100%
1.4 Python 3 #2 2.42 10,100 256 2.41 100% 0% 1% 0%
1.5 Go 2.51 7,868 685 2.50 0% 2% 100% 2%
1.6 Haskell GHC #4 2.83 16,352 341 4.13 41% 15% 17% 76%
1.6 OCaml 2.83 9,192 560 2.83 1% 0% 0% 100%
1.7 Scala #4 2.97 61,272 1125 3.53 33% 3% 73% 11%
1.8 Lua 3.03 2,888 522 3.03 2% 2% 100% 1%
1.8 Java  #2 3.12 33,528 938 3.22 3% 2% 80% 21%
1.9 PHP #2 3.36 9,160 537 3.35 0% 1% 1% 100%
2.0 Perl #4 3.48 4,392 261 3.48 1% 0% 100% 1%
2.0 Perl #3 3.50 4,444 301 3.50 0% 1% 2% 100%
2.1 Java  #3 3.54 78,228 1826 6.78 51% 45% 46% 47%
2.1 Java  #4 3.58 72,016 1808 7.29 57% 44% 46% 53%
2.1 Lua #7 3.71 3,080 477 3.71 2% 2% 100% 1%
2.3 Go #2 3.89 9,336 674 4.62 31% 30% 26% 34%
2.3 Go #4 3.92 9,912 607 4.66 27% 31% 33% 28%
2.3 Perl #2 3.99 4,512 385 3.99 0% 1% 100% 1%
2.5 Clojure #5 4.27 92,700 1944 5.80 8% 11% 19% 100%
3.2 Clojure #4 5.59 416,268 1794 8.14 50% 20% 33% 45%
6.4 Ada 2005 GNAT 10.99 4,316 1143 10.98 1% 100% 0% 1%
6.4 Pascal Free Pascal #2 10.99 2,052 785 10.98 0% 100% 1% 0%
6.5 Ruby #3 11.18 163,168 242 11.16 96% 0% 1% 6%
6.5 Ruby #4 11.20 162,720 240 11.17 58% 1% 1% 42%
6.5 Dart 11.20 41,920 321 11.30 99% 1% 1% 1%
6.5 F# Mono #3 11.22 42,344 903 11.21 0% 0% 100% 1%
6.5 C# Mono #3 11.24 41,136 1026 11.23 0% 4% 97% 1%
6.6 Smalltalk VW #4 11.35 53,816 652 11.34 0% 100% 1% 1%
7.4 Ruby JRuby #3 12.70 666,456 242 18.54 18% 46% 66% 17%
7.4 Ruby JRuby #4 12.71 657,412 240 18.13 15% 79% 34% 16%
8.3 Scala #3 14.26 383,440 479 15.54 46% 11% 18% 36%
8.8 Perl 15.10 6,632 452 15.10 0% 0% 1% 100%
9.2 Erlang #2 15.82 38,600 512 16.74 13% 22% 25% 47%
9.2 Erlang HiPE #2 15.89 36,164 512 17.32 82% 14% 8% 7%
9.4 Erlang 16.28 32,948 559 16.36 96% 1% 4% 1%
10 Java  17.30 380,352 800 18.18 30% 25% 31% 21%
10 Erlang HiPE 17.31 33,756 559 17.40 1% 1% 7% 93%
11 Clojure #2 18.54 412,108 571 21.97 36% 17% 28% 40%
11 Clojure #3 19.83 420,752 482 25.98 24% 40% 36% 33%
12 Ruby JRuby 20.76 733,468 518 28.42 90% 22% 15% 12%
12 Racket 20.88 123,692 453 20.85 0% 1% 49% 52%
13 Lisp SBCL #2 21.69 130,400 645 21.64 1% 100% 0% 1%
15 Pascal Free Pascal 25.26 652 3042 25.25 100% 1% 0% 0%
17 Ruby 29.96 163,580 518 29.90 1% 100% 0% 1%
22 C# Mono #2 38.34 68,452 856 38.44 46% 1% 1% 55%
24 F# Mono 41.01 81,280 513 41.18 1% 0% 77% 24%
283 Hack 8 min 117,868 735 8 min 44% 1% 1% 57%
310 PHP 8 min 10,080 736 8 min 56% 0% 0% 45%
Fortran Intel Failed
Lua #2 Failed
OCaml #2 Make Error
OCaml #4 Make Error
OCaml #3 Make Error
Ruby #2 Failed
Ruby #5 Failed
Scala Failed