Skip to content

bench(rwlock): add upgradable lock stage timings - #405

Open
ismaeelakin wants to merge 5 commits into
apache:mainfrom
ismaeelakin:rwlock-stage-measurements
Open

ismaeelakin wants to merge 5 commits into
apache:mainfrom
ismaeelakin:rwlock-stage-measurements

Conversation

@ismaeelakin

@ismaeelakin ismaeelakin commented Nov 3, 2026 •

Copy link
Copy Markdown

What changed

Adds stage timings for the UpgradableRwLock investigation in #404:

  • uncontended acquisition and promotion measured separately
  • acquisition while an ordinary reader is held
  • promotion while 1, 4, or 16 ordinary read guards remain held
  • promotion while a writer is queued behind the existing reservation
  • a later upgradable request queued behind a writer
  • --test support for the repository benchmark smoke run

This PR adds the measurement step requested in #404; it does not change the lock implementation or establish a speedup. Per-operation clock reads add overhead. Reader-promotion timings include dropping the readers and the wake/handoff, and queued acquisition includes the writer's handoff. The benchmark manually polls futures with a non-scheduling waker, so its timings exclude executor scheduling overhead. Treat the results as diagnostics.

Verification

Passed locally on Windows 11 (Intel Core i5-6300U):

  • cargo x test and benchmark runs with stable rustc 1.99.1
  • cargo x lint with nightly rustc 1.101.0
  • cargo x bench -- --test
  • cargo x bench --bench upgradable_stages -- --rounds 1000000 --repeat 5

The local timings and their run-to-run spread are recorded in issue #404.

Refs #404

This branch has not been deployed

No deployments
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