Benchmarks

Linux Benchmark: Bubble Sort

Bubble Sort is one of the simplest sorting algorithms that repeatedly swaps adjacent elements if they are incorrect. 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 GraalVM 4.572µs 3.987µs 5.090µs
2 C (GCC) 9.142µs 8.255µs 9.859µs
3 C (Clang) 11.906µs 11.051µs 13.445µs
4 Go 12.976µs 11.651µs 15.730µs
5 Zig 22.037µs 20.038µs 23.574µs
6 Kotlin (Native) 97.986µs 74.060µs 137.029µs
7 Java 813.627µs 82.455µs 18,199.173µs
8 C++ (Clang++) 3,004.785µs 21.100µs 74,558.578µs
9 JavaScript (Bun) 3,198.252µs 473.910µs 26,214.303µs
10 C++ (G++) 3,388.240µs 20.769µs 52,911.517µs
11 Rust 5,562.016µs 99.869µs 60,923.757µs
12 Ruby 6,021.467µs 190.501µs 61,479.847µs
13 JavaScript (Node) 6,832.403µs 200.369µs 62,244.573µs
14 Python 7,025.451µs 112.583µs 83,206.611µs
15 JavaScript (Deno) 15,430.776µs 288.485µs 57,702.593µs
16 PHP 15,899.285µs 766.755µs 73,879.694µs
17 Kotlin (JVM) 59,333.330µs 2,233.305µs 188,928.928µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times