Benchmarks

Mac 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 0.000ns 0.000ns 0.000ns
2 GraalVM 56.000ns 38.000ns 78.000ns
3 C (Clang) 101.080ns 91.000ns 125.000ns
4 C (GCC) 117.520ns 100.000ns 150.000ns
5 C++ (Clang++) 129.640ns 106.000ns 187.000ns
6 Go 160.000ns 0.000ns 1,000.000ns
7 C++ (G++) 200.000ns 0.000ns 1,000.000ns
8 Zig 240.000ns 0.000ns 1,000.000ns
9 Kotlin (Native) 344.280ns 280.000ns 941.000ns
10 Rust 520.000ns 0.000ns 1,000.000ns
11 Java 1,192.720ns 848.000ns 1,820.000ns
12 JavaScript (Node) 2,497.640ns 1,940.000ns 4,524.000ns
13 JavaScript (Bun) 3,050.800ns 2,355.000ns 4,673.000ns
14 PHP 6,657.240ns 5,795.000ns 10,733.000ns
15 Python 6,760.000ns 5,000.000ns 14,000.000ns
16 Ruby 11,560.000ns 9,000.000ns 25,000.000ns
17 JavaScript (Deno) 25,678.960ns 20,399.000ns 43,290.000ns
18 Kotlin (JVM) 46,253,726.080ns 439,650.000ns 804,954,804.000ns

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times