Skip to content

Add a zipper_head_owned benchmark#50

Open
MesTTo wants to merge 1 commit into
Adam-Vandervorst:masterfrom
MesTTo:pr/pathmap-benchmarks
Open

Add a zipper_head_owned benchmark#50
MesTTo wants to merge 1 commit into
Adam-Vandervorst:masterfrom
MesTTo:pr/pathmap-benchmarks

Conversation

@MesTTo

@MesTTo MesTTo commented Jul 4, 2026

Copy link
Copy Markdown

Summary

Adds a divan benchmark comparing an owned ZipperHead read-zipper creation
against the existing borrowed path, answering the TODO left in
src/zipper_head.rs about benchmarking that difference.

Result

Owned creation runs at roughly parity with the borrowed path (~150ns vs
~140ns per creation in local runs) — the GOAT blocks describing the open
design questions are left untouched; this only adds the measurement they
were missing.

Test plan

  • cargo test --release (660/0, matches origin/master's baseline)
  • cargo bench --bench zipper_head_owned

Answers the existing TODO on ZipperHeadOwned: compares same-thread read
creation and write creation/cleanup against the ordinary ZipperHead, at 1/10/100
repeats. Owned pays a small, roughly constant tax for the Mutex it needs to be
Sync (read creation ~150ns vs ~140-150ns borrowed; write creation/cleanup
~280-300ns vs ~260-270ns borrowed), consistent with locking overhead rather
than scaling with activity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant