The Computer Language
22.05 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.46 17,832 360    
  Racket 12.26 71,068 453    
  Lisp SBCL #3 3.48 798,484 493    
 
 
 
× source secs mem gz cpu cpu load
1.0 Free Pascal 14.64 656 3047 14.64 0% 0% 0% 100%
4.0 Rust #4 0.71 2,624 799 0.71 100% 0% 6% 0%
4.0 C gcc 0.74 2,648 452 0.73 7% 0% 100% 0%
4.5 C gcc #2 0.74 2,920 416 0.74 0% 100% 0% 1%
6.4 C++ g++ #4 0.71 4,220 513 0.71 100% 0% 0% 1%
9.5 OCaml #7 0.75 6,260 593 0.74 0% 100% 3% 1%
12 Chapel #2 0.76 7,588 423 0.76 100% 4% 1% 3%
13 Perl #4 1.85 8,356 261 1.84 0% 0% 100% 0%
13 Perl #2 1.96 8,368 389 1.96 0% 0% 100% 0%
13 Go #7 4.38 8,620 696 5.05 29% 31% 31% 24%
13 Python 3 #4 4.06 8,668 342 4.06 100% 0% 1% 0%
14 Go #2 1.57 9,032 733 1.59 32% 31% 4% 36%
14 Go 1.20 9,496 708 1.21 3% 57% 2% 44%
15 Go #8 2.54 9,924 720 2.54 2% 1% 100% 1%
19 Perl 9.93 12,616 463 9.93 0% 0% 0% 100%
21 PHP #4 0.94 13,656 389 0.93 0% 100% 1% 0%
21 PHP #5 0.92 13,728 399 0.92 1% 0% 100% 0%
21 PHP #3 0.95 13,804 504 0.95 1% 0% 100% 3%
22 PHP #2 1.46 14,172 545 1.46 1% 3% 100% 0%
23 PHP 5 min 14,912 750 5 min 100% 0% 0% 1%
27 Haskell GHC #4 1.65 17,796 348 1.95 3% 5% 95% 2%
27 Haskell GHC #3 2.01 17,796 379 2.37 37% 56% 6% 14%
27 Haskell GHC #6 1.46 17,832 360 1.71 92% 8% 8% 6%
27 Haskell GHC #2 2.02 17,916 585 2.36 3% 1% 1% 96%
28 Haskell GHC 2.04 18,092 460 2.40 1% 1% 96% 2%
29 OCaml #5 3.47 18,960 458 3.47 100% 1% 0% 1%
65 Dart #3 3.53 42,832 488 3.60 1% 99% 1% 2%
65 Dart #2 3.11 42,932 489 3.17 1% 99% 1% 0%
69 Node js #4 1.14 45,096 481 1.14 1% 100% 0% 0%
78 Erlang #3 7.80 51,196 562 9.76 3% 7% 18% 93%
81 C# .NET #7 7.34 53,276 567 8.41 22% 34% 30% 27%
85 Erlang #2 8.73 55,512 512 10.81 23% 75% 9% 12%
85 VW Smalltalk #4 8.30 55,540 753 8.30 0% 0% 0% 100%
108 Racket 12.26 71,068 453 12.25 1% 100% 1% 0%
109 Erlang 7.95 71,196 559 8.59 4% 96% 3% 8%
111 Node js #3 13.15 72,536 424 13.22 0% 1% 1% 100%
111 Node js #2 13.04 72,556 397 13.11 0% 0% 100% 0%
405 Julia 1.88 265,496 275 2.15 5% 99% 4% 6%
689 Ruby 17.66 451,736 518 17.65 0% 0% 0% 100%
  Java  7.88 513,728 800 8.94 38% 12% 32% 31%
  Ruby #2 2.74 613,348 658 2.74 0% 0% 100% 1%
  Lisp SBCL #4 3.49 792,944 489 3.49 0% 100% 0% 0%
  Lisp SBCL #3 3.48 798,484 493 3.48 0% 1% 100% 0%
  Lisp SBCL #2 6.39 830,068 648 6.39 1% 2% 4% 100%
  Ruby #5 1.52 846,476 485 1.69 10% 100% 1% 1%
Lua #5 Failed
Lua #7 Failed
Lua Failed
Python 3 #2 Bad Output
Matz's Ruby #5 Failed
Matz's Ruby #2 Failed
Matz's Ruby Bad Output
 
 
  hand-written vector instructions | "unsafe" | naked ffi
 
× source secs mem gz cpu cpu load
3.3 Free Pascal #3 0.73 2,188 487 0.73 1% 0% 99% 4%
3.9 Free Pascal #2 4.48 2,560 797 4.48 100% 0% 0% 0%
4.5 Rust #2 0.74 2,924 1306 0.74 0% 100% 0% 0%
4.5 Rust 0.74 2,928 1420 0.74 4% 0% 99% 1%
4.5 Rust #3 0.74 2,960 1366 0.83 3% 7% 3% 100%
6.5 C++ g++ #5 0.72 4,284 798 0.72 3% 100% 1% 0%
6.6 Classic Fortran #4 0.73 4,360 981 0.73 0% 100% 0% 1%
7.9 Ada 2012 GNAT #2 0.74 5,176 1130 0.74 1% 0% 100% 3%
8.2 Ada 2012 GNAT 4.49 5,380 1157 4.48 0% 0% 0% 100%
11 Chapel #4 0.76 7,452 512 0.77 99% 4% 1% 3%
12 Swift #2 0.75 8,132 600 0.74 100% 0% 1% 1%
13 Go #4 0.86 8,732 683 0.87 5% 0% 99% 2%
14 Go #3 1.16 9,320 603 1.18 1% 11% 49% 43%
18 Python 3 #3 1.13 11,968 567 1.13 1% 100% 2% 1%
20 Haskell GHC #5 100.30 12,900 928 100.41 0% 0% 0% 100%
50 C# .NET #4 1.28 32,828 1121 1.27 0% 98% 2% 0%
51 C# .NET #6 0.80 33,768 1168 0.78 1% 0% 97% 0%
52 F# .NET #6 0.82 34,380 905 0.80 0% 5% 1% 96%
54 F# .NET #4 1.28 35,412 874 1.28 0% 2% 1% 98%
54 Java #3 0.79 35,700 764 0.82 99% 0% 3% 3%
55 C# .NET #5 0.83 35,888 977 0.83 0% 98% 0% 2%
58 Java #2 1.28 38,328 938 1.53 4% 4% 80% 32%
102 Racket #2 1.02 67,012 1136 1.02 100% 1% 0% 0%
273 Julia #3 0.97 179,360 506 1.24 9% 10% 99% 8%
290 Julia #2 1.07 190,376 674 1.34 8% 99% 9% 8%