A fast, concurrent/parallel sorting library for Go with type-specific and generic slice sorting.
sorty is a concurrent and parallel sorting library for Go, designed to sort slices quickly using multiple CPU cores. It implements an innovative in-place QuickSort algorithm that requires no extra memory, providing both type-specific sorting for native Go types and generic sorting via a custom `lesswap()` function.
Go developers working with large datasets or performance-sensitive applications who need faster sorting than the standard library offers, especially those leveraging multi-core systems.
sorty offers significantly faster sorting for generic collections compared to Go's standard `sort.Interface`, with built-in concurrency, efficient resource usage, and tunable parameters for optimal performance across different hardware.
:zap: Fast Concurrent / Parallel Sorting in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Utilizes up to MaxGor goroutines for parallel sorting, speeding up large datasets on multi-core systems, as evidenced by benchmarks in the README.
Natively sorts slices of integers, floats, strings, and more efficiently, avoiding the overhead of generic interfaces for common Go types.
Only creates goroutines and channels for larger inputs, with live tuning of MaxGor to minimize overhead, making it adaptable to varying workloads.
The lesswap() function is documented to operate faster than Go's standard sort.Interface, improving performance for custom collections as highlighted in the README.
Based on QuickSort, sorty does not offer stable sorting, which limits its use in applications where preserving the order of equal elements is essential.
Achieving optimal performance requires running platform-specific tests with tags and manually updating MaxLen* parameters, adding complexity to setup.
The README admits that sorty does not recognize partially sorted slices to sort them faster, missing optimizations available in other libraries like pdqsort.