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.610µs 4.108µs 4.869µs
2 C (Clang) 12.398µs 10.760µs 30.347µs
3 Go 12.853µs 10.790µs 14.478µs
4 Zig 23.023µs 19.707µs 57.488µs
5 C++ (Clang++) 23.874µs 20.579µs 31.971µs
6 C++ (G++) 24.892µs 21.661µs 26.169µs
7 D 52.080µs 42.400µs 89.400µs
8 Java 90.132µs 83.507µs 108.023µs
9 C (GCC) 126.497µs 8.115µs 2,945.569µs
10 Python 1,107.448µs 114.334µs 24,558.585µs
11 Kotlin (Native) 1,897.076µs 83.066µs 45,174.274µs
12 Rust 1,922.957µs 103.564µs 26,070.768µs
13 JavaScript (Bun) 2,327.762µs 487.295µs 43,461.221µs
14 Ruby 4,177.698µs 194.335µs 49,699.533µs
15 JavaScript (Node) 6,153.229µs 186.100µs 56,497.829µs
16 JavaScript (Deno) 8,509.053µs 288.561µs 57,262.978µs
17 PHP 19,030.701µs 786.236µs 83,844.087µs
18 Kotlin (JVM) 64,317.464µs 2,042.224µs 128,508.506µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times