sort: add collation key arena storage to LineData

Add collation_key_buffer (arena) and collation_key_ends (offsets) to
LineData and RecycledChunk, with a collation_key() accessor. All sort
keys for a chunk are stored in a single Vec<u8> to avoid millions of
small heap allocations.
This commit is contained in:
Sylvestre Ledru
2026-03-18 23:40:54 +01:00
parent 07d6f27f32
commit b8018aebd1
+5
View File
@@ -62,6 +62,11 @@ pub struct LineData<'a> {
impl LineData<'_> {
/// Get the collation sort key for a line at the given index.
pub fn collation_key(&self, index: usize) -> &[u8] {
debug_assert!(
index < self.collation_key_ends.len(),
"collation_key index {index} out of bounds (len {})",
self.collation_key_ends.len()
);
let start = if index == 0 {
0
} else {