ALGORITHMS · research
sherlock-sort
adaptive sorting research prototype with reproducible benchmarks.
What I built
sherlock-sort profiles an input for near-sorted runs, repeated values, clustering, and distribution shape, then dispatches to an existing sorting strategy. the repository includes benchmark scripts and charts; results are limited to the tested distributions and hardware.
the idea
Profile the input before choosing a strategy.
The prototype runs a linear profiling pass for near-sortedness, clustering, repetition, and distribution shape, then selects among insertion, merge, radix, and counting-sort paths.
- O(n) pattern detection pass before sorting begins
- Adaptive dispatch to insertion, merge, radix, or counting sort
- Benchmark claims apply only to the distributions included in the repository
the benchmark
Benchmark the dispatch cost and the selected path.
The included benchmarks compare the prototype with standard-library baselines across random, sorted, reversed, clustered, and duplicate-heavy inputs. They are project measurements, not an independent performance study.
- Matches or beats std::sort across random, sorted, reversed, and clustered inputs
- Widest margin on rotated-sorted and duplicate-heavy distributions
- Benchmarked against std::sort, std::stable_sort, and qsort
Artifacts and limits
Project images and measurements are shown as project-produced material, not independent validation.


research
Last content review: July 2026. Scope is limited to the material linked on this page.
Return to projects