Benchmarks

Windows Benchmark: Binary Search (x5)

Binary Search is a search algorithm that finds the position of a target value within a sorted array. Performs a binary search through 25 sorted integers for the third, ninth, 13th, 16th, and 21st elements.

number search

All-Time Rankings

Rank Language Average Time Best Time Worst Time
1 Go 0.000µs 0.000µs 0.000µs
2 C++ (G++) 0.248µs 0.200µs 0.300µs
3 D 0.256µs 0.200µs 0.400µs
4 C (GCC) 0.364µs 0.300µs 0.600µs
5 C (Clang) 0.388µs 0.300µs 0.600µs
6 C++ (Clang++) 0.428µs 0.300µs 0.800µs
7 Kotlin (Native) 1.188µs 1.000µs 1.500µs
8 GraalVM 3.444µs 2.600µs 6.000µs
9 Zig 4.024µs 2.600µs 24.300µs
10 Rust 4.100µs 3.400µs 4.900µs
11 Java 4.692µs 4.000µs 6.000µs
12 Python 9.736µs 9.100µs 10.600µs
13 Ruby 11.504µs 9.900µs 12.800µs
14 PHP 31.740µs 18.300µs 249.300µs
15 JavaScript (Deno) 82.920µs 68.200µs 125.300µs
16 JavaScript (Node) 84.028µs 67.800µs 130.800µs
17 JavaScript (Bun) 161.592µs 129.300µs 227.000µs
18 Kotlin (JVM) 2,655.844µs 2,077.300µs 4,079.600µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times