Benchmarks

Windows 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 Go 0.000ns 0.000ns 0.000ns
2 D 56.000ns 0.000ns 100.000ns
3 GraalVM 80.000ns 0.000ns 100.000ns
4 C (Clang) 160.000ns 100.000ns 300.000ns
5 C (GCC) 176.000ns 100.000ns 200.000ns
6 C++ (G++) 180.000ns 100.000ns 200.000ns
7 C++ (Clang++) 204.000ns 100.000ns 400.000ns
8 Zig 360.000ns 200.000ns 500.000ns
9 Rust 584.000ns 500.000ns 1,100.000ns
10 Kotlin (Native) 828.000ns 500.000ns 6,700.000ns
11 Java 1,232.000ns 1,100.000ns 1,400.000ns
12 JavaScript (Node) 3,000.000ns 2,600.000ns 3,600.000ns
13 JavaScript (Bun) 3,740.000ns 3,000.000ns 5,000.000ns
14 Python 8,012.000ns 7,100.000ns 9,600.000ns
15 PHP 8,572.000ns 6,200.000ns 33,900.000ns
16 Ruby 15,132.000ns 12,300.000ns 19,400.000ns
17 JavaScript (Deno) 19,944.000ns 12,500.000ns 37,000.000ns
18 Kotlin (JVM) 911,840.000ns 609,900.000ns 4,330,700.000ns

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times