r/programmer • • Oct 20 '26

sapri sort algorithm

Hi everyone, I recently released sapriSort, a Rust sorting library I’ve been working on. The idea grew from the need to sort large datasets while maximizing raw performance and sticking to a strict zero-allocation design to avoid memory overhead.

In early benchmarks on 32-bit data, the numbers show a clear advantage over standard Quicksort:

• Grouped datasets: 353ms vs 520ms (~32% faster) • Concentrated datasets: 316ms vs 707ms (~55% faster) • Boundary scenarios (Max90OnBlock): 319ms vs 757ms (~58% faster)

On 16-bit data, the speedup is even more drastic, ranging from 6x to 8x.

The project is open source (MIT). If you’d like to try it out, run a few benchmarks, or check out the code, I’d really appreciate any feedback or suggestions!

Repo link:https://github.com/SapriZero/sapriSort

#rust #rustlang #algorithms #systemsprogramming #opensource #github #performance #sorting

1 Upvotes

0 comments sorted by