Benchmarks

Mac 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.509µs 3.418µs 19.210µs
2 C (Clang) 6.790µs 6.526µs 7.081µs
3 C (GCC) 7.295µs 7.061µs 7.497µs
4 Go 8.120µs 7.000µs 9.000µs
5 Zig 14.720µs 14.000µs 15.000µs
6 C++ (Clang++) 20.496µs 19.360µs 29.092µs
7 C++ (G++) 23.400µs 22.000µs 30.000µs
8 Kotlin (Native) 54.570µs 25.365µs 711.632µs
9 Rust 92.800µs 87.000µs 155.000µs
10 Java 183.068µs 155.727µs 386.638µs
11 PHP 233.661µs 202.529µs 450.622µs
12 Python 238.360µs 187.000µs 745.000µs
13 Ruby 258.920µs 239.000µs 427.000µs
14 JavaScript (Node) 270.081µs 249.074µs 389.037µs
15 JavaScript (Deno) 1,069.985µs 354.067µs 13,333.620µs
16 JavaScript (Bun) 2,919.620µs 341.027µs 49,153.767µs
17 Kotlin (JVM) 89,253.600µs 1,645.784µs 1,066,349.189µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times