nexus_sort_core

Crates.ionexus_sort_core
lib.rsnexus_sort_core
version1.0.1
created_at2025-07-13 02:21:10.446224+00
updated_at2025-07-13 02:41:12.121723+00
descriptionA cognitive, multi-strategy sorting framework designed for high performance.
homepage
repositoryhttps://github.com/Esrbwt1/nexus-sort.git
max_upload_size
id1749903
size36,472
(Esrbwt1)

documentation

README

Nexus Sort

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).

Core Concept

Instead of a "one size fits all" approach, NexusSort analyzes the input data and selects the optimal algorithm from its arsenal:

  • For integers, it uses its Cognitive Engine to choose between a hyper-optimized stable sort (Timsort) or unstable sort (Introsort). For random data, it defaults to a Radix Sort for maximum performance.
  • For floats, it uses a specialized f32 sorter that can leverage a bit-level Radix Sort, yielding massive performance gains over traditional comparison sorts.

Performance: Proof of Victory

Benchmarks were conducted against the Rust 1.xx.x standard library's sorting functions. The results demonstrate significant performance gains.

Integer Sorting (Random 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

Float Sorting (Random 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

Usage

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);

License

This project is licensed under the MIT License.

Commit count: 0

cargo fmt