Benchmarks

Linux Benchmark: Powers of Two

Programs that iterate through powers of two up to 2^30, through repeated multiplication.

number math exponentiation

All-Time Rankings

Rank Language Average Time Best Time Worst Time
1 D 4.000ns 0.000ns 100.000ns
2 GraalVM 69.800ns 40.000ns 111.000ns
3 C (Clang) 194.280ns 170.000ns 230.000ns
4 C++ (Clang++) 198.640ns 170.000ns 230.000ns
5 C++ (G++) 213.160ns 190.000ns 231.000ns
6 C (GCC) 243.160ns 210.000ns 390.000ns
7 Go 322.640ns 260.000ns 571.000ns
8 Zig 419.520ns 360.000ns 521.000ns
9 Kotlin (Native) 470.520ns 401.000ns 801.000ns
10 Rust 672.080ns 531.000ns 872.000ns
11 Java 1,423.520ns 1,022.000ns 3,136.000ns
12 JavaScript (Node) 2,910.720ns 2,385.000ns 3,457.000ns
13 JavaScript (Bun) 3,822.040ns 2,524.000ns 5,120.000ns
14 Ruby 8,956.400ns 7,825.000ns 11,672.000ns
15 PHP 16,634.560ns 14,177.000ns 19,377.000ns
16 JavaScript (Deno) 27,893.880ns 21,360.000ns 46,878.000ns
17 Python 912,426.400ns 7,665.000ns 15,964,447.000ns
18 Kotlin (JVM) 17,329,125.000ns 464,642.000ns 68,829,182.000ns

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times