Hacker GitHub

← All repos

orlp/glidesort

View on GitHub ↗ ★ 1,658 Rust

A Rust implementation of Glidesort, my stable adaptive quicksort/mergesort hybrid sorting algorithm.

8 mentions on Hacker News by 4 people: 2 stories, 6 comments · first 2023-02-03 · latest 2026-06-05

Mentions per year 8 mentions · busiest year 2023 (7)
20082026
  1. It's called driftsort because it's derived from another sort I made, glidesort: https://github.com/orlp/glidesort . Glidesort is a bit faster still for large inputs, however it was too large and complex for inclusion in the standard…
  2. For context this is written by the creator of Glidesort: https://github.com/orlp/glidesort
    comment by killcoder · 2023-03-06 · in The Smallest Hash Table
  3. …branchless partition operator that switches between overwriting / cmov'ing depending on data size ( https://github.com/orlp/glidesort/blob/56cacab4e378e75ab6feb... ), my own bidirectional partitioning scheme, my own pivot selection scheme,…
  4. …my question If you are reading the code, the whole small-memory magic happens in physical_merge: https://github.com/orlp/glidesort/blob/master/src/physical_m... . Lines 46-59 are the large-enough memory happy path. Lines 60-65 is the…
  5. …will fail when the scratch space isn't big enough, which mostly answers my question https://github.com/orlp/glidesort/blob/master/src/physical_m... . But I'm still not sure how that failure causes the overall algorithm to change (I have…
  6. …some code that will make glidesort back off and use less memory if the allocation request fails: https://github.com/orlp/glidesort/blob/master/src/lib.rs#L20... The sad part is that this will probably never work in reality due to…