| Crates.io | nexus_sort_core |
| lib.rs | nexus_sort_core |
| version | 1.0.1 |
| created_at | 2025-07-13 02:21:10.446224+00 |
| updated_at | 2025-07-13 02:41:12.121723+00 |
| description | A cognitive, multi-strategy sorting framework designed for high performance. |
| homepage | |
| repository | https://github.com/Esrbwt1/nexus-sort.git |
| max_upload_size | |
| id | 1749903 |
| size | 36,472 |
A cognitive, multi-strategy sorting framework in Rust, designed for high performance by intelligently choosing the best sorting strategy for your data. This library was designed and built as a collaboration between a human user and a large language model (Google's Gemini).
Instead of a "one size fits all" approach, NexusSort analyzes the input data and selects the optimal algorithm from its arsenal:
Timsort) or unstable sort (Introsort). For random data, it defaults to a Radix Sort for maximum performance.f32 sorter that can leverage a bit-level Radix Sort, yielding massive performance gains over traditional comparison sorts.Benchmarks were conducted against the Rust 1.xx.x standard library's sorting functions. The results demonstrate significant performance gains.
i32 Data)NexusSort (using its Radix path) vs. std::sort_unstable.
| Input Size | NexusSort (µs) | std::sort_unstable (µs) |
Performance Gain |
|---|---|---|---|
| 1,000 | ~12.5 µs | ~24.1 µs | ~93% Faster |
| 10,000 | ~172.3 µs | ~215.2 µs | ~25% Faster |
f32 Data)NexusSort (using its Radix path) vs. std::sort (stable).
| Input Size | NexusSort (µs) | std::sort (µs) |
Performance Gain |
|---|---|---|---|
| 1,000 | ~16.3 µs | ~50.8 µs | ~212% Faster |
| 10,000 | ~174.4 µs | ~1129.7 µs | ~547% Faster |
Add this to your Cargo.toml:
[dependencies]
nexus_sort_core = "1.0.1"
And use it in your code:
use nexus_sort_core::{nexus_sort, nexus_sort_f32};
// Sorting integers
let mut numbers = vec!;
nexus_sort(&mut numbers);
// Sorting floats
let mut floats = vec!;
nexus_sort_f32(&mut floats);
This project is licensed under the MIT License.