-
Type:
Sub-task
-
Resolution: Won't Do
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Block Manager
-
None
-
Storage Engines
-
210.392
-
SE Persistence backlog
-
None
The prototype's update_max_size function allocates a fake head node with __wt_calloc, performs the update, then frees it. This allocation/free happens on every insert/remove, adding CPU overhead and allocation churn. Eliminating this allocation improves performance.
Tasks
- src/block/block_ext.c — Rewrite update_max_size to use stack-allocated state instead of heap-allocated fake node (criterion: no malloc/calloc/free in update_max_size)
- src/block/block_ext.c — Verify that update_max_size logic is correct without the fake head: it should traverse from the changed offset upward through skiplist levels, recomputing max_size at each level (criterion: algorithm correctness preserved, validated by existing tests)
- test/suite/test_compact*.py — Run compaction test suite to ensure update_max_size works under real workload (criterion: python3 ../test/suite/run.py test_compact01 test_compact02 test_compact03 passes)
Files to create or modify
- src/block/block_ext.c — update_max_size function
Definition of Done
- update_max_size uses no heap allocations
- Algorithm correctness preserved (same results as prototype)
- Compaction tests pass, demonstrating real-world correctness