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 | C (GCC) | 128.000ns | 100.000ns | 200.000ns |
3 | C (Clang) | 144.000ns | 100.000ns | 200.000ns |
4 | C++ (G++) | 152.000ns | 100.000ns | 200.000ns |
5 | C++ (Clang++) | 224.000ns | 100.000ns | 600.000ns |
6 | Kotlin (Native) | 564.000ns | 500.000ns | 800.000ns |
7 | Rust | 620.000ns | 500.000ns | 800.000ns |
8 | Java | 1,244.000ns | 1,000.000ns | 1,500.000ns |
9 | JavaScript (Node) | 4,124.000ns | 3,100.000ns | 6,000.000ns |
10 | JavaScript (Bun) | 6,556.000ns | 2,900.000ns | 36,400.000ns |
11 | Python | 8,264.000ns | 7,200.000ns | 10,700.000ns |
12 | PHP | 9,600.000ns | 6,500.000ns | 15,500.000ns |
13 | Ruby | 14,580.000ns | 11,400.000ns | 39,500.000ns |
14 | JavaScript (Deno) | 31,848.120ns | 22,500.000ns | 85,600.000ns |
15 | Kotlin (JVM) | 1,998,552.000ns | 517,800.000ns | 32,969,800.000ns |