Benchmarks

Windows 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 Go 0.000µs 0.000µs 0.000µs
2 C (GCC) 8.924µs 8.000µs 10.200µs
3 D 9.116µs 8.100µs 13.500µs
4 GraalVM 9.260µs 6.800µs 42.800µs
5 C (Clang) 13.144µs 9.700µs 40.300µs
6 C++ (Clang++) 20.568µs 18.000µs 38.800µs
7 Zig 27.268µs 23.500µs 80.500µs
8 C++ (G++) 35.176µs 31.200µs 37.700µs
9 Java 86.168µs 72.000µs 139.900µs
10 Rust 124.944µs 115.000µs 187.000µs
11 Kotlin (Native) 162.848µs 97.300µs 752.000µs
12 Python 169.116µs 156.500µs 213.400µs
13 PHP 172.248µs 150.300µs 381.800µs
14 JavaScript (Node) 213.636µs 200.100µs 234.500µs
15 Ruby 234.136µs 204.800µs 374.600µs
16 JavaScript (Deno) 1,023.516µs 319.300µs 5,020.600µs
17 Kotlin (JVM) 8,990.700µs 2,094.200µs 100,513.800µs
18 JavaScript (Bun) 105,065.452µs 35,406.700µs 248,191.400µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times