The Computer Language
24.06 Benchmarks Game

pidigits

Arbitrary precision arithmetic might be provided by wrapping a third-party library written in some-other programming language. How would you know?

First a few simple programs.

Then optimisations, multicore parallelism, [pdf] vector parallelism.

Last hand-written vector instructions and "unsafe" programs and the more obvious foreign function interface programs.

  source secs mem gz    
  Haskell GHC #6 1.62 19,688 368    
  Lisp SBCL #3 3.49 616,192 499    
  Racket 10.41 77,952 459    
 
 
 
× source secs mem gz cpu secs cpu load
1.0 Rust #4 0.71 19,076 804 0.71 0% 1% 1% 100%
1.1 Chapel #2 0.76 19,976 423 0.77 98% 5% 2% 1%
1.1 C gcc #2 0.82 19,704 422 0.82 100% 1% 1% 1%
1.2 C gcc 0.89 19,704 459 0.88 1% 100% 0% 1%
1.2 C++ g++ #4 0.89 19,736 521 0.88 1% 1% 1% 100%
1.3 OCaml #7 0.89 19,864 603 0.89 1% 98% 1% 1%
1.4 PHP #5 1.03 19,656 405 1.03 1% 1% 100% 0%
1.5 PHP #4 1.04 19,656 396 1.04 100% 0% 0% 1%
1.5 PHP #3 1.05 19,656 510 1.05 0% 100% 0% 0%
1.7 Node.js #4 1.23 56,100 487 1.26 0% 0% 2% 99%
1.9 Go 1.34 19,700 715 1.36 75% 1% 0% 27%
2.1 PHP #2 1.46 19,656 552 1.46 100% 0% 0% 0%
2.1 Matz's Ruby #5 1.52 285,696 488 1.52 88% 2% 0% 12%
2.2 Ruby yjit #5 1.57 852,480 494 1.57 100% 1% 0% 0%
2.3 Haskell GHC #6 1.62 19,688 368 1.67 2% 75% 22% 2%
2.6 Haskell GHC #4 1.83 19,688 355 1.89 66% 6% 2% 27%
3.1 Go #2 2.18 19,700 740 2.23 47% 15% 38% 0%
3.1 Haskell GHC #3 2.21 19,688 387 2.28 36% 60% 1% 2%
3.1 Haskell GHC #2 2.23 19,688 592 2.29 24% 6% 65% 6%
3.1 Haskell GHC 2.24 19,688 466 2.31 29% 15% 32% 26%
3.5 Go #8 2.51 19,700 727 2.51 1% 0% 99% 0%
4.0 Dart #2 2.82 19,664 496 2.87 83% 17% 1% 1%
4.0 OCaml #5 2.88 19,672 465 2.88 0% 100% 1% 0%
4.4 Erlang #3 3.15 68,836 568 4.20 30% 69% 5% 29%
4.5 Ruby yjit #2 3.18 2,172,920 666 3.18 45% 0% 0% 55%
4.5 Dart #3 3.18 19,664 495 3.23 0% 99% 0% 0%
4.6 Erlang #2 3.26 75,544 518 5.16 27% 52% 26% 55%
4.7 Erlang 3.36 94,388 565 4.11 10% 23% 7% 81%
4.9 Lisp SBCL #4 3.49 621,184 495 3.49 0% 0% 100% 0%
4.9 Lisp SBCL #3 3.49 616,192 499 3.49 0% 0% 100% 0%
6.5 Python 3 #4 4.61 19,652 348 4.61 0% 0% 99% 0%
7.3 Go #7 5.19 19,700 702 5.98 28% 28% 31% 27%
8.7 Lisp SBCL #2 6.21 628,500 655 6.21 100% 0% 0% 1%
9.2 C# .NET #7 6.59 53,412 579 7.20 4% 37% 45% 23%
11 Java  7.63 491,600 807 8.66 34% 18% 28% 32%
12 VW Smalltalk #4 8.42 55,680 757 8.42 0% 99% 0% 0%
15 Racket 10.41 77,952 459 10.41 0% 100% 0% 0%
17 Node.js #2 12.45 84,544 405 12.47 0% 1% 99% 0%
18 Node.js #3 12.53 84,420 431 12.55 0% 99% 0% 0%
19 Perl 13.27 19,684 471 13.26 0% 100% 0% 0%
21 Free Pascal 14.68 19,720 3068 14.67 0% 0% 100% 0%
24 Ruby yjit 16.81 104,064 524 16.81 0% 0% 100% 1%
466 PHP 5 min 19,656 756 5 min 0% 100% 0% 0%
Lua #7 Failed
Lua #5 Failed
Lua Failed
Perl #2 Failed
Perl #4 Failed
Python 3 #5 Failed
Matz's Ruby #2 Failed
Matz's Ruby Bad Output
 
 
  hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu secs cpu load
1.0 Rust #3 0.74 19,076 1373 0.74 0% 0% 100% 0%
1.0 Rust 0.74 19,076 1426 0.74 1% 2% 100% 1%
1.1 Rust #2 0.75 19,076 1312 0.75 100% 1% 1% 1%
1.1 Chapel #4 0.75 19,720 515 0.76 100% 0% 0% 2%
1.2 C++ g++ #5 0.87 19,736 804 0.87 2% 0% 0% 100%
1.2 Free Pascal #3 0.87 20,008 536 0.87 0% 1% 0% 100%
1.2 Classic Fortran #4 0.88 19,652 987 0.88 2% 2% 100% 0%
1.2 Ada 2012 GNAT #2 0.88 19,828 1137 0.88 1% 0% 100% 2%
1.2 Swift #2 0.89 19,700 606 0.89 2% 98% 1% 0%
1.3 C# .NET #5 0.93 35,096 990 0.96 4% 1% 1% 97%
1.3 Java #3 0.94 40,944 770 0.96 1% 98% 1% 3%
1.3 F# .NET #6 0.96 31,680 917 0.95 97% 1% 0% 2%
1.3 Go #4 0.96 19,700 689 0.98 1% 1% 1% 99%
1.3 C# .NET #6 0.96 33,240 1182 0.95 0% 0% 3% 99%
1.4 Julia #3 1.02 242,944 512 1.14 5% 9% 99% 0%
1.6 Julia #2 1.12 250,752 686 1.24 86% 0% 9% 16%
1.9 Python 3 #3 1.33 19,652 573 1.33 0% 0% 100% 0%
1.9 Racket #2 1.34 79,448 1142 1.34 0% 100% 0% 1%
1.9 F# .NET #4 1.34 33,524 887 1.37 98% 0% 2% 3%
1.9 Java #2 1.35 44,528 944 1.42 4% 25% 3% 76%
1.9 C# .NET #4 1.36 33,952 1135 1.35 2% 99% 0% 1%
2.3 Go #3 1.65 19,700 610 1.69 1% 28% 49% 24%
7.5 Free Pascal #2 5.37 19,672 834 5.37 0% 0% 100% 0%
7.6 Ada 2012 GNAT 5.39 19,892 1163 5.38 100% 0% 0% 0%
168 Haskell GHC #5 119.74 19,688 934 119.92 0% 100% 0% 0%