Benchmarks

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 (GCC) 8.982µs 8.306µs 11.221µs
2 C (Clang) 11.911µs 10.289µs 23.515µs
3 Go 13.086µs 10.710µs 24.827µs
4 C++ (G++) 24.559µs 20.479µs 28.063µs
5 Java 87.877µs 80.420µs 121.509µs
6 Kotlin (Native) 312.602µs 138.170µs 4,167.633µs
7 Ruby 657.941µs 206.297µs 11,104.505µs
8 Rust 1,265.434µs 89.728µs 29,209.486µs
9 C++ (Clang++) 2,464.581µs 19.948µs 61,052.766µs
10 JavaScript (Deno) 4,191.429µs 289.784µs 35,834.542µs
11 Python 4,532.222µs 118.824µs 65,112.884µs
12 JavaScript (Bun) 7,214.565µs 495.811µs 52,122.620µs
13 JavaScript (Node) 8,182.028µs 279.454µs 92,809.300µs
14 PHP 17,256.968µs 783.621µs 83,042.346µs
15 Kotlin (JVM) 51,956.462µs 1,666.889µs 107,070.650µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times