Benchmarks

Mac Benchmark: sqrt(x) (1K)

Benchmark the performance of the sqrt function, between 1 and 1,000.

number math 1K

All-Time Rankings

Rank Language Average Time Best Time Worst Time
1 GraalVM 0.356µs 0.286µs 0.601µs
2 D 1.048µs 1.000µs 1.300µs
3 Go 1.960µs 1.000µs 3.000µs
4 Kotlin (Native) 3.533µs 1.856µs 35.579µs
5 C++ (Clang++) 5.244µs 5.160µs 5.625µs
6 C (Clang) 5.275µs 5.140µs 6.874µs
7 Zig 5.960µs 5.000µs 8.000µs
8 C (GCC) 8.025µs 7.272µs 9.073µs
9 C++ (G++) 8.680µs 8.000µs 11.000µs
10 Rust 9.520µs 7.000µs 49.000µs
11 Java 28.443µs 25.308µs 47.595µs
12 JavaScript (Node) 50.051µs 44.206µs 85.338µs
13 JavaScript (Deno) 73.188µs 60.364µs 110.010µs
14 PHP 77.284µs 68.244µs 141.358µs
15 Ruby 123.080µs 104.000µs 291.000µs
16 Python 206.160µs 150.000µs 784.000µs
17 JavaScript (Bun) 1,463.191µs 118.451µs 25,730.911µs
18 Kotlin (JVM) 27,526.982µs 434.919µs 655,993.593µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times