Benchmarks

Linux 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) 6.858µs 5.641µs 25.859µs
2 GraalVM 7.761µs 7.153µs 8.656µs
3 C (Clang) 9.074µs 7.434µs 27.162µs
4 Go 18.140µs 15.309µs 21.250µs
5 C++ (G++) 25.975µs 23.875µs 27.592µs
6 C++ (Clang++) 29.735µs 26.931µs 32.591µs
7 Rust 54.260µs 44.764µs 72.246µs
8 Python 134.300µs 120.607µs 151.223µs
9 Java 721.554µs 45.815µs 16,804.730µs
10 Kotlin (Native) 836.298µs 370.957µs 10,459.039µs
11 D 1,469.140µs 63.800µs 31,069.700µs
12 JavaScript (Deno) 4,398.898µs 218.040µs 49,326.891µs
13 JavaScript (Node) 4,478.369µs 211.898µs 39,363.163µs
14 JavaScript (Bun) 6,634.574µs 775.596µs 47,499.957µs
15 Zig 8,147.001µs 530.686µs 70,779.092µs
16 PHP 16,409.466µs 486.684µs 90,639.782µs
17 Ruby 17,545.286µs 366.158µs 67,981.533µs
18 Kotlin (JVM) 77,161.389µs 2,327.276µs 126,902.846µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times