Skip to content
Back to Benchmarks

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.

Contextual results

Algorithms Tested

Readable implementations included in this run

Native JavaScript Sort

Runtime Baseline

Array.prototype.sort((a, b) => a - b); runtime baseline, not a pure algorithm comparison.

Quick Sort

Divide And Conquer

Readable three-way quicksort with a median-of-three pivot choice.

Merge Sort

Divide And Conquer

Stable out-of-place merge sort.

Heap Sort

Heap

In-place max-heap sort over the cloned input.

Shell Sort

Gap Sequence

Readable Shell Sort using the Ciura gap sequence prefix 701, 301, 132, 57, 23, 10, 4, 1.

Insertion Sort

Quadratic

Simple in-place insertion sort, useful for small or nearly sorted inputs.

Selection Sort

Quadratic

Educational in-place selection sort for small inputs.

Bubble Sort

Quadratic

Educational bubble sort with early exit.

Counting Sort

Integer Linear

Range-limited integer counting sort.

Radix Sort

Integer Linear

Least-significant-digit radix sort for non-negative integers.

Input profiles

Fixture coverage in this family

RandomSortedReverseNearly SortedMany DuplicatesSmall Range IntegersFew Unique

Input sizes

Fixture coverage in this family

1001,00010,00050,000

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.

ProfileSizeAlgorithmMedian ms
Few Unique100Counting Sort0.001
Few Unique1,000Counting Sort0.006
Few Unique10,000Counting Sort0.048
Few Unique50,000Counting Sort0.292
Many Duplicates100Insertion Sort0.001
Many Duplicates1,000Quick Sort0.012
Many Duplicates10,000Quick Sort0.224
Many Duplicates50,000Quick Sort1.69
Nearly Sorted100Insertion Sort0
Nearly Sorted1,000Insertion Sort0.006

Aggregate Rank Summary

Convenience ranks across compatible measured cells. Skipped cells mean rows are not directly comparable.

AlgorithmMeasuredAvg rankMedianFastestSkipped
Counting Sort82.1251620
Shell Sort282.393250
Quick Sort283.107330
Native JavaScript Sort283.5380
Insertion Sort163.8133.5412
Radix Sort84.3753.5020
Heap Sort284.393400
Merge Sort286.357600

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

sorting-baseline.jsonsorting-baseline-summary.jsonsorting-baseline.mdsorting-baseline.csv

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.