folly::stable_radix_sort_detail

Implementation details for the stable radix sort.

Types

NameDescription
DefaultProjection Default projection that handles common types.
TransformingProjection Projection wrapper that applies type-appropriate transformation.

Functions

NameDescription
extractRadixDigit Extract the radix digit at the given pass index from a key. Pass 0 extracts the least significant digit.
insertionSort Stable insertion sort for small inputs. O(n^2) but fast for small n due to low overhead.
stableRadixSort Wrapper that handles buffer allocation and fallback to std::stable_sort.
stableRadixSortImpl Core LSD radix sort implementation with alternating buffers.

Variables

NameDescription
kRadixBits Number of bits processed per radix pass.
kRadixBuckets Number of counting-sort buckets per pass (2^kRadixBits).
kRadixMask Mask selecting the low kRadixBits of a digit.
kRadixPasses Number of radix passes needed to sort a key of the given type.
kRadixSortThreshold Size threshold below which we fall back to insertion sort.