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 | C (Clang) | 7.185µs | 6.800µs | 7.545µs |
2 | C (GCC) | 7.596µs | 7.308µs | 8.014µs |
3 | Go | 17.720µs | 9.000µs | 221.000µs |
4 | C++ (Clang++) | 22.430µs | 19.806µs | 51.222µs |
5 | C++ (G++) | 24.560µs | 23.000µs | 27.000µs |
6 | Kotlin (Native) | 39.601µs | 31.884µs | 152.061µs |
7 | Rust | 92.560µs | 85.000µs | 200.000µs |
8 | Java | 174.356µs | 163.112µs | 353.358µs |
9 | Python | 216.520µs | 187.000µs | 418.000µs |
10 | JavaScript (Node) | 314.505µs | 286.138µs | 537.171µs |
11 | Ruby | 335.360µs | 248.000µs | 764.000µs |
12 | PHP | 346.124µs | 210.427µs | 1,884.988µs |
13 | JavaScript (Deno) | 814.699µs | 363.925µs | 4,094.990µs |
14 | JavaScript (Bun) | 1,814.904µs | 363.320µs | 14,354.884µs |
15 | Kotlin (JVM) | 2,145.859µs | 1,352.816µs | 5,858.560µs |