bwtRadixSortDeep
private fn
void bwtRadixSortDeep(uint[] indices, const(ubyte)[] block,
uint lo, uint hi, int depth, uint[] temp) pure nothrowDeeper radix sort for large buckets with repetitive data. Uses single-byte radix at each level with efficient batch skipping.
Optimizations:
- Reuses temp buffer instead of allocating per depth level
- Batch skips uniform byte sequences by sampling first
- Uses ternary radix quicksort for medium buckets (faster than counting sort)
- Uses iteration instead of recursion when all bytes are identical
- Falls back to introsort for small buckets
Parameters
indices | Array of indices to sort. |
block | The data block that indices refer to. |
lo | Start of the range to sort (inclusive). |
hi | End of the range to sort (exclusive). |
depth | Current byte depth for comparison. |
temp | Reusable temporary buffer (must be at least n elements). |