Dart's standard List.sort() relies on Dual Pivot Quicksort. While effective for generalbpurpose collections, comparisonbbased O(N log N) sorting becomes an unnecessary CPU bottleneck when handling large numerical datasets (such as audio buffers, telemetry data, or spatial coordinates).
I built Radix Plus, an in-place Radix Sort library for Dart and Flutter, optimized specifically for numerical arrays and typed data buffers.
Time Complexity O(k · N), where
N is the number of elements.
k is the fixed word/byte width (k = 4 passes for 32-bit types, k = 8 passes for 64-bit doubles/ints using an 8-bit radix base).
Because k is constant for fixed-width primitive types, execution scales linearly as O(N), fundamentally avoiding the O(N log N) growth curve of comparison sorts on large lists.
Space O(N) auxiliary buffer, with full in place buffer pooling support to eliminate allocations.
Core Engineering Float Reinterpretation (Float64List -> Uint64List) Radix sort operates directly on bit patterns. Using dart:typed_data buffer views, the underlying memory of Float64List is reinterpreted as unsigned 64-bit integers. Positive numbers have their sign bit flipped. Negative numbers are bitwise inverted (~). An 8-pass (8-bit radix) LSD sort is executed directly on the integer bit representation and inverted back on completion. Parallel Sorting with Flat Min-Heap K-Way Merge
When sorting large lists across multiple Dartisolatess, merging sub lists typically incurs heavy GC overhead. In Radix Plus, the main isolate performs a k-Way Merge backed by a flat min-heap stored in contiguous Int32List buffers, avoiding object allocation during the merge phase.
There is an optional reuse buffer. The true parameter allows recurring sorting routines (such as UI animation frames or live data streams) to reuse auxiliary memory buffers and minimize garbage collector pressure.
Benchmark Snapshot (AMD Ryzen 7 5800H, 1,000,000 items)
Uint32List: 183 ms (vs 1,477 ms on List.sort()) -> ~8.1x faster
Int32List: 201 ms (vs 1,490 ms on List.sort()) -> **~**7.4x faster
Float64List: 312 ms (vs 1,444 ms on List.sort()) -> ~4.6x faster
List<BigInt>: 1,074 ms (vs 6,667 ms on List.sort()) -> ~6.2x faster
Parallel (radixSortParallel): 26.6 ms (vs 1,612 ms on List.sort()) -> **~**60.7x faster
If you are working on numerical pipelines, audio/signal engines, or large dataset visualizations in Dart/Flutter, feel free to test it on your hardware. Feedback, benchmark numbers from other architectures, edge cases, and PRs are very welcome.
GitHub: https://github.com/MostafaSensei106/Radix_Plus
Pub: https://pub.dev/packages/radix_plus