-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Labels
coreWork on the algorithm design and implementationWork on the algorithm design and implementationenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededhugeLarge task potentially involving architectural or breaking changesLarge task potentially involving architectural or breaking changesperformancePerformance related discussion or suggestionPerformance related discussion or suggestion
Description
Describe what you are looking for
For lexicographic sorting of strings, StringZilla uses a "hybrid-hybrid" approach with
- Radix sort for first bytes exported into a continuous buffer for locality.
- IntroSort on partially ordered chunks to balance efficiency and worst-case performance.
- IntroSort begins with a QuickSort.
- If the recursion depth exceeds a certain threshold, it switches to a HeapSort.
That approach has several issues.
- The current solution can't work for arrays over 4 billion entries.
- It's also potentially illformed on 32-bit systems.
- It doesn't use SIMD anywhere, not even for the Radix step.
- It loses to hybrid algorithm prototype built with
std::sortby a factor of 3!
So there is a lot we can improve, and there several links to keep in mind for anyone considering collaborating here.
- Sorting networks are marvelous structures and there is a collection of fast circuits by @bertdobbelaere we can implement with SIMD.
- Similar to TimSort, once sorted chunks are produced, one can merge them more efficiently using SIMD techniques implemented in SimSIMD for set intersections in v5.3 for SVE2, AVX-512, and AVX2.
This is not an inclusive list, and I'm open to other algorithmic ideas.
Can you contribute to the implementation?
- I can contribute
Is your feature request specific to a certain interface?
It applies to everything
Contact Details
No response
Is there an existing issue for this?
- I have searched the existing issues
Code of Conduct
- I agree to follow this project's Code of Conduct
lin72h
Metadata
Metadata
Assignees
Labels
coreWork on the algorithm design and implementationWork on the algorithm design and implementationenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededhugeLarge task potentially involving architectural or breaking changesLarge task potentially involving architectural or breaking changesperformancePerformance related discussion or suggestionPerformance related discussion or suggestion