Benchmarks

Mac Benchmark: Merge Sort

Merge Sort is a sorting algorithm that divides-and-conquers by recursively dividing the array into two halves until each sub-array has only one element. This benchmark measures the time it takes to sort an array of 50 unsorted numbers. Implementation modified from GeeksForGeeks.

number algorithm

All-Time Rankings

Rank Language Average Time Best Time Worst Time
1 C (GCC) 4.813µs 4.631µs 5.060µs
2 GraalVM 5.956µs 5.165µs 11.106µs
3 C (Clang) 6.995µs 5.073µs 46.174µs
4 C++ (G++) 39.360µs 37.000µs 55.000µs
5 Go 40.440µs 28.000µs 131.000µs
6 C++ (Clang++) 48.015µs 43.934µs 80.402µs
7 Kotlin (Native) 49.851µs 33.889µs 390.385µs
8 Rust 59.400µs 56.000µs 85.000µs
9 Java 72.851µs 55.949µs 408.972µs
10 PHP 110.576µs 105.909µs 128.589µs
11 Python 147.680µs 121.000µs 464.000µs
12 JavaScript (Deno) 228.443µs 221.426µs 241.154µs
13 JavaScript (Node) 251.755µs 229.120µs 351.217µs
14 Zig 341.320µs 328.000µs 372.000µs
15 JavaScript (Bun) 13,956.475µs 427.186µs 272,901.209µs
16 Ruby 45,348.840µs 220.000µs 1,124,554.000µs
17 Kotlin (JVM) 46,304.274µs 1,636.989µs 1,046,362.146µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times