Fixes for a bunch of prune issues - #141
Conversation
Adding prune benchmarks. 30% speedup in checked zipper-head zipper-creations & cleanup
Bench A/B vs base: donejob log · 2026-09-26 17:31:20 UTC base e4b167c → head 387c0a7, 3 round(s), median of each run averaged; negative is faster
34 case(s) moved more than 5%
Full tables per bench are in the job log and the bench-out artifact. |
| /// Dangling paths may be pruned down to `prune_limit` bytes of `key`. | ||
| /// `usize::MAX` disables pruning. | ||
| /// WARNING: This method may leave the node empty | ||
| fn node_remove_val(&mut self, key: &[u8], prune: bool) -> Option<V>; |
There was a problem hiding this comment.
prune_limit seems to commit harder to the idea of pruning, and in that direction I like it. However, usize::MAX is less ergonomic than true, and I don't think that's the right place to take the API. I believe we should have a "prune-free" API, and an API that gives you the control if you want it. I don't know what this looks like yet, it could be node_remove_val(&mut self, key: &[u8]) and node_remove_val_dangle(&mut self, key: &[u8], prune_limit: usize)
There was a problem hiding this comment.
This isn't exposed. This is the zipper-to-node contract. The externally-facing API is unchanged.
| let mut zipper = all_paths.read_zipper(); | ||
| match Conflict::check_for_lock_along_path(path, &mut zipper) { | ||
| fn check_for_write_conflict<C, ConflictF: FnOnce(&[u8])->C>(path: &[u8], zipper: &mut WriteZipperOwned<()>, conflict_f: ConflictF) -> Result<(), C> { | ||
| zipper.reset(); |
There was a problem hiding this comment.
I'd like to see the performance impact of tracking with this change
There was a problem hiding this comment.
I added prune benchmarks. It's almost twice as fast to create tracked zippers. But with the _unchecked version of the calls used by mork, nothing changes in either direction.
#138 was the tip of the iceberg. Hopefully this PR makes prune and the prune flag consistent.