The Computer Language
Benchmarks Game

pidigits

Always look at the source code.

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.

× source secs mem gz busy cpu load
1.0 Chapel #3 0.76 6,192 512 0.81 100% 1% 1% 4%
1.0 Chapel #4 0.76 6,224 512 0.77 100% 0% 0% 1%
1.0 Chapel #2 0.76 6,172 423 0.80 100% 1% 0% 3%
1.1 C gcc #2 0.81 2,664 416 0.84 1% 0% 100% 2%
1.1 Free Pascal #3 0.87 2,008 530 0.90 2% 0% 100% 1%
1.1 Ada 2012 GNAT #2 0.87 4,512 1130 0.90 0% 1% 100% 2%
1.1 Intel Fortran #4 0.87 3,912 981 0.89 1% 100% 1% 0%
1.2 C gcc 0.88 2,660 452 0.93 1% 100% 1% 3%
1.2 OCaml #7 0.88 5,868 593 0.98 1% 100% 2% 8%
1.2 Rust #3 0.88 2,936 1366 0.93 1% 100% 0% 4%
1.2 Rust 0.88 2,904 1420 0.90 0% 100% 2% 0%
1.2 C++ g++ #4 0.89 4,236 513 0.89 0% 0% 100% 0%
1.2 Rust #2 0.89 2,908 1306 0.88 0% 0% 0% 99%
1.2 Swift #2 0.89 8,484 600 0.90 0% 100% 1% 0%
1.2 Haskell GHC #5 0.89 6,048 1694 0.90 0% 100% 1% 0%
1.2 C# .NET Core #5 0.94 34,960 973 0.97 4% 3% 95% 1%
1.2 Java  #3 0.94 35,604 764 0.99 1% 4% 3% 97%
1.3 C# .NET Core #6 0.97 31,120 1168 0.98 95% 0% 3% 3%
1.3 F# .NET Core #6 0.97 34,372 905 0.98 1% 96% 1% 3%
1.3 PHP #5 0.99 9,116 399 1.01 1% 0% 1% 100%
1.3 Julia #3 1.00 167,828 506 1.29 9% 11% 10% 99%
1.3 PHP #3 1.00 9,076 504 1.02 1% 1% 99% 1%
1.3 PHP #4 1.00 9,112 389 1.02 0% 99% 1% 2%
1.5 Julia #2 1.11 176,676 674 1.40 10% 99% 10% 8%
1.5 Racket #2 1.16 36,792 1136 1.18 0% 0% 1% 100%
1.6 Go #3 1.25 9,120 603 1.24 0% 48% 0% 51%
1.7 Python 3 #3 1.29 11,976 567 1.30 0% 100% 1% 0%
1.7 Node js #5 1.30 36,036 599 1.32 0% 1% 100% 1%
1.8 Java #2 1.35 38,700 938 1.51 4% 98% 1% 9%
1.8 C# .NET Core #4 1.37 30,612 1121 1.38 1% 1% 2% 97%
1.8 F# .NET Core #4 1.37 35,468 874 1.43 4% 4% 97% 0%
1.8 Go 1.37 10,164 708 1.48 4% 100% 3% 1%
1.8 Ruby #5 1.41 303,640 485 2.50 39% 30% 10% 99%
1.9 PHP #2 1.44 9,400 545 1.52 1% 100% 1% 3%
2.0 Python 3 #2 1.56 10,352 386 1.60 1% 1% 100% 1%
2.0 Julia 1.56 224,420 275 1.82 6% 6% 6% 99%
2.2 Go #2 1.65 9,500 733 1.73 54% 1% 4% 46%
2.2 Haskell GHC #6 1.67 8,204 360 2.08 8% 8% 100% 8%
2.5 Perl #4 1.89 8,344 261 1.90 100% 1% 0% 0%
2.5 Haskell GHC #4 1.93 9,212 348 2.56 11% 10% 99% 12%
2.7 Perl #2 2.03 8,236 389 2.07 1% 100% 1% 0%
3.1 Haskell GHC #2 2.34 9,756 585 3.07 10% 10% 100% 12%
3.1 Haskell GHC #3 2.35 9,568 379 2.98 8% 9% 100% 9%
3.1 Haskell GHC 2.36 8,908 460 3.07 9% 10% 100% 11%
4.0 Ruby #2 3.07 190,172 658 5.32 31% 29% 100% 13%
4.1 Lisp SBCL #3 3.14 126,572 493 3.17 0% 0% 100% 1%
4.4 Dart #2 3.33 149,040 500 3.60 5% 4% 4% 95%
5.1 Python 3 #4 3.86 8,896 342 3.87 0% 100% 0% 0%
5.9 OCaml #5 4.51 19,228 458 4.54 100% 1% 0% 0%
7.0 Free Pascal #2 5.35 2,460 828 5.38 100% 0% 0% 0%
7.0 Ada 2012 GNAT 5.35 4,600 1157 5.37 100% 0% 0% 0%
7.6 Lisp SBCL #2 5.79 135,704 648 5.85 0% 1% 0% 100%
8.2 Node js #4 6.22 64,652 530 6.34 68% 26% 4% 4%
9.5 VW Smalltalk #4 7.22 54,952 753 7.22 0% 0% 100% 0%
9.9 Java 7.53 410,888 800 8.52 21% 25% 33% 34%
10 Erlang HiPE #3 7.89 28,324 562 8.51 2% 3% 96% 6%
11 Erlang HiPE #2 8.41 33,836 512 11.28 6% 23% 10% 96%
12 Erlang HiPE 8.78 30,548 559 8.95 1% 0% 0% 100%
13 Perl 9.98 12,800 463 10.01 0% 0% 0% 100%
15 Racket 11.18 129,172 453 11.23 0% 100% 0% 0%
17 Node js #3 13.24 64,652 553 13.38 40% 32% 5% 24%
19 Free Pascal 14.64 656 3060 14.70 100% 0% 0% 0%
23 Ruby 17.15 191,316 518 18.80 5% 95% 2% 7%
428 PHP 5 min 10,432 736 5 min 0% 9% 82% 9%
Lua #5 Failed
Lua Failed
Lua #7 Failed
Matz's Ruby #5 Failed
Matz's Ruby Bad Output
Matz's Ruby #2 Failed