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.244µs 0.200µs 0.300µs
3 C (GCC) 0.324µs 0.200µs 0.500µs
4 C (Clang) 0.396µs 0.300µs 0.600µs
5 C++ (Clang++) 0.444µs 0.300µs 0.900µs
6 Kotlin (Native) 1.228µs 1.100µs 1.500µs
7 GraalVM 3.876µs 2.600µs 4.700µs
8 Zig 4.180µs 2.900µs 24.700µs
9 Java 4.520µs 3.900µs 6.500µs
10 Rust 4.540µs 4.100µs 5.100µs
11 Python 9.324µs 8.600µs 11.700µs
12 Ruby 12.108µs 10.300µs 14.100µs
13 PHP 27.788µs 19.200µs 61.400µs
14 JavaScript (Node) 93.832µs 74.200µs 157.200µs
15 JavaScript (Deno) 140.792µs 60.700µs 999.200µs
16 JavaScript (Bun) 197.592µs 132.800µs 363.200µs
17 Kotlin (JVM) 12,211.020µs 2,166.100µs 241,029.800µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times