Benchmark Family
Sorting
Deterministic numeric-array benchmarks for readable sorting implementations and a native runtime baseline.
Generated
Apr 28, 2026, 12:07 PM
Measured
200
Skipped
80
Failures
0
Algorithms
10
Input profiles
7
How to Read These Results
Benchmarks measure specific local JavaScript implementations on deterministic inputs. Results depend on runtime, hardware, implementation details, and input shape. They are not universal algorithm rankings.
Native JavaScript sort is included as a runtime baseline, while quadratic algorithms are skipped at larger sizes.
Algorithms Tested
Readable implementations included in this run
Native JavaScript Sort
Runtime BaselineArray.prototype.sort((a, b) => a - b); runtime baseline, not a pure algorithm comparison.
Quick Sort
Divide And ConquerReadable three-way quicksort with a median-of-three pivot choice.
Merge Sort
Divide And ConquerStable out-of-place merge sort.
Heap Sort
HeapIn-place max-heap sort over the cloned input.
Shell Sort
Gap SequenceReadable Shell Sort using the Ciura gap sequence prefix 701, 301, 132, 57, 23, 10, 4, 1.
Insertion Sort
QuadraticSimple in-place insertion sort, useful for small or nearly sorted inputs.
Selection Sort
QuadraticEducational in-place selection sort for small inputs.
Bubble Sort
QuadraticEducational bubble sort with early exit.
Counting Sort
Integer LinearRange-limited integer counting sort.
Radix Sort
Integer LinearLeast-significant-digit radix sort for non-negative integers.
Input profiles
Fixture coverage in this family
Input sizes
Fixture coverage in this family
Summary Findings
Careful takeaways from the generated benchmark data
- 200 measured cases completed with 0 correctness failures.
- Native JavaScript sort is included as a runtime baseline, not a pure algorithmic comparison.
- Educational quadratic implementations are skipped at larger sizes to keep the benchmark bounded.
Fastest by Profile and Size
A compact preview of fastest measured implementations for selected profile/size cells.
| Profile | Size | Algorithm | Median ms |
|---|---|---|---|
| Few Unique | 100 | Counting Sort | 0.001 |
| Few Unique | 1,000 | Counting Sort | 0.006 |
| Few Unique | 10,000 | Counting Sort | 0.048 |
| Few Unique | 50,000 | Counting Sort | 0.292 |
| Many Duplicates | 100 | Insertion Sort | 0.001 |
| Many Duplicates | 1,000 | Quick Sort | 0.012 |
| Many Duplicates | 10,000 | Quick Sort | 0.224 |
| Many Duplicates | 50,000 | Quick Sort | 1.69 |
| Nearly Sorted | 100 | Insertion Sort | 0 |
| Nearly Sorted | 1,000 | Insertion Sort | 0.006 |
Aggregate Rank Summary
Convenience ranks across compatible measured cells. Skipped cells mean rows are not directly comparable.
| Algorithm | Measured | Avg rank | Median | Fastest | Skipped |
|---|---|---|---|---|---|
| Counting Sort | 8 | 2.125 | 1 | 6 | 20 |
| Shell Sort | 28 | 2.393 | 2 | 5 | 0 |
| Quick Sort | 28 | 3.107 | 3 | 3 | 0 |
| Native JavaScript Sort | 28 | 3.5 | 3 | 8 | 0 |
| Insertion Sort | 16 | 3.813 | 3.5 | 4 | 12 |
| Radix Sort | 8 | 4.375 | 3.5 | 0 | 20 |
| Heap Sort | 28 | 4.393 | 4 | 0 | 0 |
| Merge Sort | 28 | 6.357 | 6 | 0 | 0 |
Interpretation notes
Context for interpreting this family
- Small-range integer profiles are compatible with counting-style methods.
- Nearly sorted inputs are a distinct profile and should not be generalized to random data.
- Results are local measurements for these implementations.
Outputs
Generated benchmark artifacts used by this public page
Limitations
Scope boundaries for this benchmark family
- Numeric arrays only.
- Single-process JavaScript timing depends on local runtime and system load.
- Native sort is a runtime baseline.