Benchmarks

Mac 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 C (GCC) 0.153µs 0.099µs 0.330µs
2 D 0.160µs 0.100µs 0.200µs
3 C++ (G++) 0.200µs 0.000µs 1.000µs
4 C (Clang) 0.208µs 0.154µs 0.298µs
5 C++ (Clang++) 0.318µs 0.264µs 0.627µs
6 Go 0.480µs 0.000µs 1.000µs
7 Rust 0.640µs 0.000µs 1.000µs
8 Kotlin (Native) 0.810µs 0.731µs 1.042µs
9 Zig 2.080µs 2.000µs 3.000µs
10 GraalVM 2.351µs 0.237µs 49.540µs
11 Java 3.639µs 3.180µs 5.469µs
12 Ruby 8.360µs 7.000µs 12.000µs
13 Python 10.520µs 8.000µs 22.000µs
14 PHP 17.295µs 15.054µs 22.041µs
15 JavaScript (Deno) 70.802µs 61.842µs 93.783µs
16 JavaScript (Node) 124.297µs 69.280µs 1,084.852µs
17 JavaScript (Bun) 180.161µs 140.122µs 549.029µs
18 Kotlin (JVM) 42,142.186µs 1,487.838µs 934,629.795µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times