Skip to content

perf(store): lock-gap — how big a gap between a writer's transactions lets another write in - #279

Merged
leemour merged 1 commit into
mainfrom
perf/store-lock-gap
Oct 31, 2026
Merged

leemour merged 1 commit into
mainfrom
perf/store-lock-gap

Conversation

@leemour

@leemour leemour commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Task

Publish the measurement behind WireCatLabs/cli-core#2249 (the lock test passed by luck) and WireCatLabs/cli-core#2255 (writeBatch pauses 2 ms after each batch), with the script that produced it.

Why

Those numbers were only in the two PR descriptions. The page answers how big a gap a writing loop must leave so another process's write gets in, for both cli-core's 1 ms retry and SQLite's own wait.

What

  • performance/store/lock-gap/: the README, bench.mjs and results.md.
  • A line in performance/store/README.md.

Headline (20 tries each, 20 ms hold):

pause after commit 1 ms retry failed SQLite's own wait failed
none 8/20 20/20
0.3 ms 0/20 5/20
2 ms 0/20 (worst 25 ms) 0/20 (worst 335 ms)

Testing

  • node performance/store/lock-gap/bench.mjs 20 0,0.3,2 produced results.md.
  • biome and rumdl pass on the new files.
  • pnpm docs:check fails on main already, on a link at performance/store/README.md that points to a heading missing from the gcal-baseline page. It's not touched here.

🤖 Generated with Claude Code

… lets another write in

With no pause after each commit, a 1 ms retry failed 8 of 20 tries and
SQLite's own wait 20 of 20; 0.3 ms let the retry in every time; 2 ms let
both in. Backs cli-core#2249 and #2255.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit cc87af0 into main Oct 31, 2026
1 check passed
@leemour
leemour deleted the perf/store-lock-gap branch October 31, 2026 22:51
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