OrderLanguageImplementationCodeRelative
Time
1C Clang 14.0.6 mandel.c 2.29
2C Clang 14.0.6 with -O3 mandel.c 1.04
3Python Codon 0.18.2 mandel_hinted.py 1.65
4Python CPython 3.13.3 mandel_untyped.py 38.03
5Python CPython 3.13.3 with type hints mandel_hinted.py 38.00
6Python CPython 3.13.3 with -O mandel_hinted.py 37.86
7Python CPython 3.8.20 mandel_untyped.py 69.26
8Cython Cython 3.1.1 mandel_hinted.py 4.87
9Cython Cython 3.1.1 mandel_typed.pyx 1.01
10Cython Cython 3.1.1 mandel_untyped.py 58.81
11Dart Dart 3.8.0 mandel.dart 1.34
12C# .NET core 9.0.300 with dotnet build Mandel.cs 2.19
13C# .NET core 9.0.300 with dotnet publish Mandel.cs 1.10
14C GCC 12.2.0 mandel.c 2.11
15C GCC 12.2.0 with -march=native mandel.c 1.07
16C GCC 12.2.0 with -O3 mandel.c 1.00
17Go gccgo 12.2.0 mandel.go 2.19
18Go gccgo 12.2.0 with -O3 mandel.go 1.06
19Haskell GHC 9.0.2 mandel.hs 30.62
20Haskell GHC 9.0.2 with -O3 mandel.hs 2.05
21Go golang-go 1.19.8 mandel.go 1.06
22C GraalVM (+ Clang) 23.0.1 mandel.c 1.31
23Java GraalVM 23.0.1 Mandel.java 1.52
24JavaScript GraalVM 23.0.1 mandel.js 1.25
25Python GraalVM 23.0.1 mandel_hinted.py 2.31
26Ruby GraalVM 23.0.1 mandel.rb 1.57
27PHP HHVM 4.170.1 mandel.hack 1.28
28Hack HHVM 4.170.1 mandel-typed.hack 1.32
29Haskell Hugs September 2006 mandel.hs 1459.18 *
30Ruby JRuby 10.0.0.1 mandel.rb 16.01
31Python2 Jython 2.7.3 mandel_untyped.py 33.11
32Kotlin Kotlin 2.1.21 on OpenJDK mandel.kt 1.31
33Kotlin Kotlin 2.1.21 with -jvm-target mandel.kt 1.31
34Nim Nim 1.6.10 mandel.nim 2.18
35Nim Nim 1.6.10 with --opt mandel.nim 0.98
36Python Nuitka 2.7.3 mandel_untyped.py 62.42
37Python Numba 0.58.1 on Python 3.8 mandel_untyped.py 69.22
38OCaml OCaml 4.13.1 mandel.ml 18.24
39OCaml OCaml 4.13.1 with ocamlopt mandel.ml 1.74
40Java OpenJDK 17.0.15 with -client Mandel.java 1.23
41Java OpenJDK 17.0.15 with -server Mandel.java 1.23
42C PCC 1.2.0.DEVEL mandel.c 2.13
43C PCC 1.2.0.DEVEL with -O2 mandel.c 2.20
44PHP PHP 8.4.7 mandel.php 9.63
45C PicoC v2.2 compiled with -O3 mandel.c 627.40 *
46Python PyPy 7.3.11 mandel_untyped.py 1.17
47Python PyPy 7.3.11 mandel_hinted.py 1.17
48Python Pythran 0.18.0 mandel_pyth.py 1.65
49R R Patched mandel.R 28.12
50JavaScript Rhino Snapshot mandel.js 8.46
51RPython PyPy rpython translator 0.2.1 targetmandel.py 1.05
52Ruby Ruby 3.4.4 mandel.rb 47.10
53Rust Rust 1.63.0 mandel.rs 5.13
54Rust Rust 1.63.0 with opt-level=3 mandel.rs 1.04
55OCaml OCaml 2.11.12 on OpenJDK Mandel.scala 1.37
56JavaScript SpiderMonkey 102.15.1 mandel.js 1.22
57Swift Swift 6.1 mandel.swift 1.61
58C TCC 0.9.27 mandel.c 2.12
59JavaScript V8/NodeJS 10.2.154.26-node.28 mandel.js 1.07

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 “13th Gen Intel(R) Core(TM) i7-13700K”.

Each test generated a 400×400 Mandelbrot set, with at most 40000 iterations on each “pixel” (except the slowest tools, where the time is extrapolated from smaller runs. The test was repeated 3 times, and the times averaged. Actual times: 1 “time unit” = 2.93 s.