Compare commits

...

3 Commits

Author SHA1 Message Date
yongkangc
04503cda33 fix: remove deleted benchmark entry and fix clippy doc lints 2026-01-15 16:01:09 +00:00
yongkangc
15f1829225 perf(trie): optimize kway_merge_sorted - return Vec directly and use dedup_by
- Change return type from impl Iterator to Vec<(K,V)> to avoid double-collect
  (previously collected internally then callers collected again)
- Replace coalesce() with simpler dedup_by() for duplicate key handling
- Update all callers to remove redundant .collect() calls
2026-01-15 16:01:04 +00:00
yongkangc
89b61a8031 refactor(trie): optimize merge_overlay_trie_input for efficiency
- Improved the merge_overlay_trie_input function to handle single block cases directly.
- Collected trie data upfront to minimize repeated calls and pre-allocated capacity for merging.
- Added a new with_capacity method in TrieUpdates for better performance during trie updates.
2026-01-15 16:00:36 +00:00

View File

@@ -2,9 +2,9 @@
/// Threshold for switching from `extend_ref` loop to `merge_batch` in `merge_overlay_trie_input`.
///
/// Benchmarked crossover: `extend_ref` wins up to ~64 blocks, `merge_batch` wins beyond.
/// Using 64 as threshold since they're roughly equal there.
const MERGE_BATCH_THRESHOLD: usize = 64;
/// Benchmarked crossover: `extend_ref` wins up to ~30 blocks, `merge_batch` wins beyond.
/// Using 30 as threshold since they're roughly equal there.
const MERGE_BATCH_THRESHOLD: usize = 30;
use crate::tree::{
cached_state::CachedStateProvider,