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.152µs 0.106µs 0.271µs
2 C (Clang) 0.225µs 0.173µs 0.583µs
3 C++ (G++) 0.320µs 0.000µs 1.000µs
4 C++ (Clang++) 0.322µs 0.271µs 0.635µs
5 GraalVM 0.326µs 0.272µs 0.454µs
6 Rust 0.560µs 0.000µs 1.000µs
7 Go 0.720µs 0.000µs 1.000µs
8 Kotlin (Native) 0.853µs 0.724µs 1.161µs
9 Zig 2.080µs 1.000µs 3.000µs
10 Python 9.400µs 8.000µs 10.000µs
11 Java 9.655µs 3.393µs 153.275µs
12 Ruby 11.640µs 7.000µs 97.000µs
13 PHP 22.234µs 16.580µs 131.541µs
14 JavaScript (Deno) 78.131µs 68.037µs 151.129µs
15 JavaScript (Node) 91.782µs 73.786µs 333.386µs
16 JavaScript (Bun) 178.239µs 134.904µs 421.518µs
17 Kotlin (JVM) 4,952.816µs 1,455.248µs 35,081.227µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times