The Computer Language
Benchmarks Game

pidigits

We accept something intermediate between chaos and rigidity — enough flex & slop & play to allow for Haskell programs that are not just mechanically translated from Fortran; enough similarity in the basic workloads & tested results.

Programming language advocates and curious programmers have contributed new programs and introduced newer techniques. Look at the slower simple sequential programs, and  look at the parallel programs written for multicore, and  look at the low-level programs written for SIMD. Always look at the source code.

× source secs mem gz busy cpu load
1.0 Chapel #2 1.63 6,224 423 1.70 100% 1% 2% 1%
1.0 Chapel 1.63 6,180 501 1.68 99% 1% 2% 1%
1.1 Free Pascal #3 1.73 2,436 530 1.80 99% 1% 1% 2%
1.1 Fortran Intel #4 1.74 3,964 981 1.80 99% 1% 3% 0%
1.1 Swift #2 1.75 8,632 600 1.77 0% 99% 2% 0%
1.1 C gcc 1.75 2,660 452 2.02 1% 100% 14% 1%
1.1 Rust #3 1.75 3,172 1366 1.80 2% 1% 0% 100%
1.1 Ada 2012 GNAT #2 1.75 4,580 1130 1.78 100% 0% 2% 0%
1.1 Rust 1.75 3,176 1420 2.07 13% 99% 1% 6%
1.1 Rust #2 1.75 3,072 1306 1.79 1% 1% 0% 100%
1.2 C gcc #2 1.88 2,656 416 1.92 1% 1% 1% 100%
1.2 C++ g++ #4 1.89 4,460 513 1.97 100% 2% 2% 1%
1.3 Go #3 2.03 8,684 603 2.08 1% 1% 0% 100%
1.3 C# .NET Core #5 2.10 38,208 973 2.15 3% 97% 2% 0%
1.3 PHP #5 2.16 9,112 399 2.25 100% 2% 2% 0%
1.3 PHP #4 2.18 9,172 389 2.38 4% 6% 100% 0%
1.3 PHP #3 2.19 9,172 504 2.21 0% 100% 1% 0%
1.5 Julia #2 2.41 163,924 674 2.82 99% 7% 5% 5%
1.6 Racket #2 2.59 49,620 1136 2.64 0% 1% 1% 100%
1.7 Racket CS #2 2.70 82,376 1136 2.74 0% 100% 0% 1%
1.8 Go 2.94 8,744 708 2.98 57% 18% 6% 21%
1.8 Go #2 2.96 8,856 733 3.03 0% 100% 2% 0%
1.9 Java  #2 3.07 39,680 938 3.30 99% 3% 0% 5%
1.9 C# .NET Core #4 3.10 36,396 1121 3.17 0% 100% 1% 1%
1.9 F# .NET Core #4 3.11 37,908 874 3.18 0% 100% 2% 1%
1.9 C# .NET Core #3 3.11 37,024 1026 3.19 1% 100% 1% 1%
1.9 F# .NET Core #3 3.15 38,692 909 3.23 2% 100% 0% 0%
2.0 Ruby #5 3.22 328,844 485 7.50 77% 49% 75% 33%
2.0 F# .NET Core #5 3.23 43,136 865 3.32 1% 98% 2% 2%
2.0 PHP #2 3.25 9,480 545 3.29 0% 100% 1% 1%
2.1 Python 3 #2 3.47 10,140 386 3.52 0% 1% 100% 0%
2.2 Perl #4 3.61 7,780 261 3.72 2% 0% 100% 1%
2.4 Perl #2 3.88 7,708 389 3.97 0% 100% 2% 1%
2.6 Haskell GHC #3 4.20 10,248 379 5.32 86% 9% 8% 23%
2.6 Haskell GHC #2 4.24 9,764 585 5.28 53% 8% 9% 55%
3.0 Julia 4.91 192,912 275 5.50 3% 6% 4% 99%
4.1 OCaml #5 6.74 20,004 458 6.96 1% 1% 100% 1%
5.7 Ruby #2 9.24 205,492 658 18.93 77% 92% 13% 24%
6.7 Free Pascal #2 10.94 2,672 828 11.07 100% 0% 0% 1%
6.7 Ada 2012 GNAT 10.94 4,728 1157 11.08 0% 100% 1% 0%
6.8 Dart snapshot #2 11.06 98,676 500 11.37 1% 100% 1% 1%
6.9 Dart #2 11.29 128,372 500 11.91 2% 2% 3% 98%
7.2 Dart aot #2 11.63 28,080 500 11.73 73% 0% 0% 27%
7.6 Lisp SBCL #3 12.28 129,808 493 12.44 100% 1% 1% 0%
8.3 Node js #4 13.56 63,708 530 13.81 20% 0% 0% 81%
8.5 Erlang HiPE #3 13.82 47,588 562 16.92 42% 56% 8% 17%
8.9 Erlang HiPE #2 14.51 44,928 512 17.78 56% 10% 12% 44%
9.2 VW Smalltalk #4 15.00 54,968 753 15.59 3% 0% 55% 46%
9.6 Pharo Smalltalk 15.55 98,340 698 15.83 100% 1% 1% 0%
10 Erlang HiPE 16.14 39,948 559 16.80 1% 96% 6% 1%
12 Java 19.39 361,624 800 21.09 44% 2% 50% 12%
14 Lisp SBCL #2 22.08 127,992 648 22.42 100% 1% 0% 0%
15 F# .NET Core #2 24.51 80,556 701 26.37 11% 41% 45% 11%
15 Racket CS 24.54 91,712 453 24.85 0% 0% 1% 100%
15 JRuby 24.66 746,836 518 36.07 15% 61% 45% 24%
15 Node js #3 25.13 63,564 553 25.55 20% 36% 1% 44%
16 Free Pascal 25.23 652 3060 25.49 0% 1% 100% 0%
16 Racket 26.72 133,616 453 27.17 1% 100% 0% 1%
17 Truffle Ruby 27.81 959,252 518 74.31 67% 78% 46% 76%
17 Substrate VM 28.24 267,884 800 28.40 0% 100% 0% 1%
18 Matz's Ruby 29.43 18,384 518 29.65 100% 0% 0% 0%
18 Ruby 29.85 131,208 518 61.57 93% 52% 51% 11%
24 F# .NET Core 39.51 105,268 513 41.92 12% 41% 40% 14%
335 PHP 9 min 10,480 736 9 min 100% 1% 0% 0%
C++ g++ #3 Timed Out
Fortran Intel #3 Make Error
Fortran Intel Failed
Haskell GHC #4 Make Error
Haskell GHC Make Error
Substrate VM #2 Failed
Lisp SBCL #4 Failed
Lisp SBCL Bad Output
Lua #7 Failed
Lua Failed
Lua #5 Failed
Perl Failed
Matz's Ruby #5 Failed
Matz's Ruby #2 Failed
JRuby #5 Failed
Truffle Ruby #5 Failed
Truffle Ruby #2 Failed
Swift Make Error