Banchmark
Environment
CPU: Intel Core i9-10900K 3.7GHz (uses 4 core)
Mem: 16GB
OS: ArchLinux 5.17.2 on VirtualBox
Sample Code
int fib(int n)
{
if (n < 2) {
return n;
} else {
return fib(n-1) + fib(n-2);
}
}
Result
The 39th Fibonacci Number (63,245,986)
Language | Version | Time(sec) | Note | |
---|---|---|---|---|
1 | Basic (FreeBasic) | 1.09.0 | 0.089 | -O 3 |
2 | Ada (GCC) | 11.2.0 | 0.092 | gnatmake -O3 |
3 | C (GCC) | 11.2.0 | 0.100 | gcc -O3 |
3 | C++ (GCC) | 11.2.0 | 0.100 | g++ -O3 |
5 | D (GCC) | 11.2.0 | 0.107 | gdc -O3 |
6 | Nim | 1.4.8 | 0.118 | -opt:speed -d:release |
7 | Rust | 1.60.0 | 0.122 | opt-level=3 |
8 | Fortran (GCC) | 11.2.0 | 0.135 | gfortran -O3 |
9 | C (clang) | 13.0.1 | 0.154 | clang -O3 |
10 | Swift | 5.6 | 0.203 | swiftc -O |
11 | OCaml | 4.13.1 | 0.205 | ocamlopt |
12 | Crystal | 1.4.0 | 0.208 | --release |
13 | Java (OpenJDK) | 11.0.15 | 0.209 | |
14 | Go | 1.18.1 | 0.213 | |
15 | Kotlin | 1.6.20 | 0.214 | native code |
16 | Pascal (FreePascal) | 3.2.2 | 0.256 | -O4 -Tlinux |
17 | Haskell (ghc) | 9.0.2 | 0.273 | |
18 | C# (Mono) | 6.12.0.0 | 0.291 | -optimize+ |
19 | D (dmd) | 2.099.0 | 0.311 | -O -inline |
20 | Kotlin | 1.6.20 | 0.321 | bytecode |
21 | Julia | 1.7.2 | 0.340 | |
22 | VisualBasic (Mono) | 0.0.0.5943 | 0.346 | /optimization+ |
23 | Dart | 2.16.2 | 0.362 | |
24 | Standard ML (MLton) | 20210117 | 0.412 | |
25 | Swift | 5.6 | 0.421 | JIT |
26 | Chapel | 1.26.0 | 0.467 | |
27 | V | 0.2.4 | 0.481 | compiled |
28 | Scala | 2.13.8 | 0.513 | bytecode |
29 | Lua | 5.4.4 | 0.538 | luajit |
30 | Javascript (Nodejs) | 17.9.0 | 0.539 | |
31 | V | 0.2.4 | 0.631 | |
32 | Erlang | OTP 24 | 0.645 | |
33 | Lisp (sbcl) | 2.2.2 | 0.833 | |
34 | Elixir | 1.13.2 | 1.006 | |
35 | PHP | 8.1.5 | 1.138 | opcache.jit=tracing |
36 | Javascript (spidermonkey) | C91.8.0 | 1.142 | |
37 | OCaml | 4.13.1 | 1.486 | |
38 | Scala | 2.13.8 | 1.515 | |
39 | Groovy | 4.0.1 | 1.787 | |
40 | Clojure | 1.11.1.1105 | 2.063 | |
41 | PHP | 8.1.5 | 2.088 | |
42 | Forth | 0.7.3 | 2.260 | gforth-fast |
43 | Neko | 2.3.0 | 2.929 | |
44 | Scheme (Chicken) | 5.3.0 | 3.412 | csc -O3 |
45 | Lua | 5.4.4 | 3.752 | |
46 | Pike | 8.0.1738 | 4.153 | |
47 | Smalltalk (GNU) | 3.2.92 | 4.487 | |
48 | Ruby | 3.1.2p20 | 4.552 | |
49 | Prolog (GNU Prolog) | 1.5.0 | 4.642 | gplc |
50 | Euphoria | 4.1.0 | 8.193 | |
51 | Squirrel | 3.2 | 11.057 | |
52 | Python | 3.10.4 | 11.184 | |
53 | Icon | 9.5.21b | 14.577 | |
54 | Prolog (SWI-Prolog) | 8.4.2 | 20.105 | |
55 | Oz | 2.0.1 | 20.545 | |
56 | Perl | 5.34.1 | 25.085 |
The 30th Fibonacci Number (832,040)
Language | Version | Time(sec) | Note | |
---|---|---|---|---|
56 | Perl | 5.34.1 | 0.316 | |
57 | Scheme (Chicken) | 5.3.0 | 0.482 | csi |
58 | bc | 1.07.1 | 0.608 | |
59 | Raku | 2022.03 | 0.728 | |
60 | R | 4.1.3 | 0.922 | |
61 | dc | 1.4.1 | 1.245 | |
62 | COBOL (GnuCOBOL) | 3.1.2.0 | 1.822 | |
63 | io | 2017.09.06 | 2.113 | |
64 | tcl | 8.6.12 | 3.126 | |
65 | REXX (Regina) | 3.9.4 | 3.472 | |
66 | APL (GNU APL) | 1.8 | 3.692 | |
67 | Maxima | 5.45.1 | 5.123 | |
68 | Octave | 7.1.0 | 9.016 | |
69 | Ring | 1.17 | 13.910 | |
70 | arturo | 0.9.80 | 127.7 | |
71 | Bash | 5.1.016 | - |