Order | Language | Implementation | Code | Relative Time |
---|---|---|---|---|
1 | Python3 | CPython 3.9.5 | dynamic.py | 494.67 |
2 | Python3 | CPython 3.9.5 with -O |
dynamic.py | 490.50 |
3 | Python2 | CPython 2.7.18 | dynamic.py | 499.18 |
4 | Python2 | CPython 2.7.18 with -O |
dynamic.py | 501.00 |
5 | Python3 | Cython 0.29.23 | dynamic.py | 355.32 |
6 | Cython | Cython 0.29.23 | static.pyx | 9.98 |
7 | Python2 | Jython 2.7.2-DEV | dynamic.py | 194.20 |
8 | Python3 | Numba 0.53.1 | mandel_numba.py | 11.14 |
9 | Python3 | Pythran 0.9.11 | mandel_pyth.py | 10.76 |
10 | Python3 | Nuitka 0.6.15 | dynamic.py | 601.15 |
11 | Python3 | Pyston 2.2.0 | dynamic.py | 199.61 |
12 | Python3 | Cinder 3.8.5+cinder | dynamic.py | 589.80 |
13 | Python3 | GraalVM 20.2.0 | dynamic.py | 13.57 |
14 | Python2 | PyPy2 7.3.3 | dynamic.py | 9.91 |
15 | Python3 | PyPy3 7.3.5 | dynamic.py | 9.93 |
16 | Haskell | GHC 8.8.4 | mandel.hs | 257.93 |
17 | Haskell | GHC 8.8.4 with -O3 |
mandel.hs | 16.82 |
18 | C | GCC 10.3.0 | mandel.c | 17.46 |
19 | C | GCC 10.3.0 with -O3 |
mandel.c | 10.00 |
20 | C | GCC 10.3.0 with -march=native |
mandel.c | 10.37 |
21 | C | Clang version | mandel.c | 17.45 |
22 | C | Clang version with -O2 |
mandel.c | 10.50 |
23 | C | GraalVM (+ Clang) 20.2.0 | mandel.c | 10.97 |
24 | C | pcc 1.2.0.DEVEL | mandel.c | 17.43 |
25 | C | pcc 1.2.0.DEVEL with -O2 |
mandel.c | 17.43 |
26 | C | tcc 0.9.27 | mandel.c | 17.44 |
27 | Java | Oracle Java 16.0.1 | Mandel.java | 10.62 |
28 | Java | Oracle Java 16.0.1 with -server |
Mandel.java | 10.61 |
29 | Java | OpenJDK 17 | Mandel.java | 10.61 |
30 | Java | OpenJDK 17 with -server |
Mandel.java | 10.59 |
31 | Java | GraalVM 20.2.0 | Mandel.java | 11.18 |
32 | OCaml | OCaml 4.11.1 with ocamlopt |
mandel.ml | 15.11 |
33 | OCaml | OCaml 4.11.1 with ocamlc |
mandel.ml | 166.26 |
34 | Scala | Scala 2.11.12 on OpenJDK | Mandel.scala | 13.39 |
35 | Kotlin | Kotlin 1.5.10 on OpenJDK | mandel.kt | 11.07 |
36 | Kotlin | Kotlin 1.5.10 with -jvm-target | mandel.kt | 11.06 |
37 | C# | .NET core 5.0.300 | Mandel.cs | 19.54 |
38 | JavaScript | V8/NodeJS 7.8.279.23-node.45 | mandel.js | 10.42 |
39 | JavaScript | SpiderMonkey 78.4.0 | mandel.js | 10.39 |
40 | JavaScript | Rhino 1.7.7.2 | mandel.js | 68.39 |
41 | JavaScript | GraalVM 20.2.0 | mandel.js | 11.08 |
42 | Dart | Dart 2.13.1 | mandel.dart | 11.20 |
43 | Rust | Rust 1.50.0 | mandel.rs | 87.31 |
44 | Rust | Rust 1.50.0 with opt-level=3 |
mandel.rs | 10.34 |
45 | Go | gccgo 10.3.0 | mandel.go | 18.02 |
46 | Go | gccgo 10.3.0 with -O3 |
mandel.go | 10.62 |
47 | Go | golang-go 1.16.2 | mandel.go | 10.85 |
48 | Nim | Nim 1.4.2 | mandel.nim | 19.82 |
49 | Nim | Nim 1.4.2 with --opt |
mandel.nim | 10.00 |
50 | Ruby | Ruby 3.0.0 | mandel.rb | 513.87 |
51 | Ruby | Ruby 2.7 2.7.2 | mandel.rb | 450.17 |
52 | Ruby | JRuby 9.2.9.0 | mandel.rb | 662.18 |
53 | Ruby | GraalVM 20.2.0 | mandel.rb | 10.63 |
54 | R | R 4.0.4 | mandel.R | 297.99 |
55 | R | GraalVM 20.2.0 | mandel.R | 33.83 |
56 | PHP | PHP 7.4.16 | mandel.php | 92.53 |
57 | PHP | HHVM 4.111.0 | mandel.hack | 10.71 |
58 | Hack | HHVM 4.111.0 | mandel-typed.hack | 10.44 |
59 | RPython | PyPy rpython translator | targetmandel.py | 10.52 |
60 | C | PicoC 10.3.0 compiled with -O3 |
mandel.c | 7190.17 |
61 | Haskell | Hugs September 2006 | mandel.hs | 15367.78 |
Times are measured by calling getrusage
before and after running the subprocess, and summing the difference in the ru_utime
and ru_stime
. Only the test code itself is timed, not any compilation process. The tests were done on a processor that reported itself as “Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz”.
Each test generated a 800×320 Mandelbrot set, with at most 60000 iterations on each pixel (except the slowest tools, where the time is extrapolated from 600 iterations). The test was repeated 3 times, and the times averaged. Actual times: 1 “time unit” = 1.15 s.