Refactor write_pointer_table to accept iterators instead of requiring materialized vectors, eliminating temporary allocations in L1 table sync operations. Changes: - Modified write_pointer_table() to take Iterator<Item = &T> and dereference internally before passing owned values to the callback - Added write_pointer_table_direct() convenience wrapper for cases without value transformation - Updated sync_caches() to use l1_table.iter() directly instead of .get_values().iter().copied() - Implemented Deref<Target = [T]> for VecCache to enable direct .iter() Performance impact: - Eliminates L1 table allocation during sync (~2KB per 100GB disk) - L2 and refcount table writes already used slices, no change there - Zero performance overhead: iterator dereferencing is equivalent to .copied() and optimizes identically The L1 sync previously collected entries into a Vec to apply the OFLAG_COPIED flag. The new iterator+callback pattern computes this on-the-fly, avoiding the allocation entirely. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||