From acc3517e9047b31e1c13ecd8c71c8d220d03bf6d Mon Sep 17 00:00:00 2001 From: boris Date: Sat, 29 Aug 2026 21:08:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=80=9F=E6=97=A5=E5=BA=A6=E8=A1=8C?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E7=B4=A2=E5=BC=95=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/data.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/fidc-core/src/data.rs b/crates/fidc-core/src/data.rs index 44e1cda..863b24c 100644 --- a/crates/fidc-core/src/data.rs +++ b/crates/fidc-core/src/data.rs @@ -566,7 +566,9 @@ struct SymbolPriceSeries { valid_volume_start_by_count: Vec, } -type DenseRowPositionIndex = BTreeMap>; +// Row groups keep their chronological BTreeMap for range scans, while the +// hot symbol-id lookup uses a hash index to avoid a tree traversal per row. +type DenseRowPositionIndex = AHashMap>; const MISSING_ROW_POSITION: u32 = u32::MAX; const MAX_DENSE_ROW_INDEX_BYTES: usize = 256 * 1024 * 1024; @@ -4062,7 +4064,7 @@ fn build_dense_row_positions( return None; } - let mut positions_by_date = BTreeMap::new(); + let mut positions_by_date = AHashMap::new(); for (date, rows) in groups { let symbol_ids = symbol_ids_by_date.get(date)?; if rows.len() != symbol_ids.len() {