Skip to content

lock first, then wait - #459

Merged
chee merged 8 commits into
mainfrom
lockwait
Oct 23, 2026
Merged

chee merged 8 commits into
mainfrom
lockwait

Conversation

@chee

@chee chee commented Oct 22, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Benchmarks: Patchwork with this PR against main

a386e6e against main at 0e83ec2, Patchwork as it ships (patchwork mode), measured one after the other on the same runner (run). Lower is better throughout. A row is in the table when every run of the PR came out on the same side of every run of main, with the medians more than 20% apart; every benchmark is below it.

benchmark main PR change
…the server confirmed every edit within 5s ok 2/3 ok fails 1 of 3
every benchmark: the median of 3 runs of main and 3 runs of the PR, their range in brackets
benchmark main PR change
boot → repo, first tab (1 tabs) 204 ms (204–240) 215 ms (203–222) +5%
boot → server connected, first tab (1 tabs) 535 ms (526–547) 541 ms (537–541) +1%
renderer memory, all tabs + workers (1 tabs) 404 MB (401–406) 400 MB (393–402) −1%
renderer processes (1 tabs) 3 3
boot → repo, first tab (3 tabs) 223 ms (212–226) 213 ms (209–220) −4%
boot → repo, last tab (3 tabs) 164 ms (147–169) 162 ms (146–221) −1%
boot → server connected, first tab (3 tabs) 616 ms (579–660) 734 ms (640–757) +19%
renderer memory, all tabs + workers (3 tabs) 738 MB (729–739) 736 MB (729–748) −0%
renderer processes (3 tabs) 5 5
boot → repo, first tab (10 tabs) 219 ms (218–558) 215 ms (213–216) −2%
boot → repo, last tab (10 tabs) 153 ms (152–155) 155 ms (152–264) +1%
boot → server connected, first tab (10 tabs) 758 ms (612–1089) 690 ms (599–705) −9%
renderer memory, all tabs + workers (10 tabs) 1881 MB (1872–1917) 1882 MB (1875–1899) +0%
renderer processes (10 tabs) 12 12
sync still works after the first tab closes ok ok
edit → seen + confirmed, after first tab closed 146 ms (144–148) 146 ms (144–146)
server link seen down while offline FAIL FAIL
…and the server did not see the offline edits FAIL FAIL
tabs converged while offline, over a local channel ok ok
offline edits in two tabs both survive reconnect ok ok
reconnect → tabs converged (only where they hadn't already) – –
…and a fresh tab sees both ok ok
boot → doc open, tab 1 672 ms (657–741) 668 ms (660–677) −1%
boot → doc open, tab 2 249 ms (241–252) 256 ms (248–262) +3%
boot → doc open, tab 10 237 ms (230–242) 244 ms (238–247) +3%
open 40 tabs, wall clock 7614 ms (7517–7637) 7578 ms (7490–8224) −0%
boot → repo, last of 40 tabs 55 ms (54–56) 59 ms (50–65) +7%
boot → linked, last of 40 tabs – –
boot → server connected, last of 40 tabs 159 ms (159–164) 155 ms (150–158) −3%
renderer memory, 40 tabs 7290 MB (7227–7345) 7297 MB (7285–7340) +0%
renderer processes, 40 tabs 42 42
39 tabs find the doc: median 629 ms (609–644) 617 ms (616–685) −2%
39 tabs find the doc: slowest 720 ms (684–766) 718 ms (705–758) −0%
…all 39 found it ok ok
…finds that needed a retry (of 39) 0 0
edit → seen in 39 tabs: median tab 31 ms (31–33) 29 ms (29–31) −4%
edit → seen in 39 tabs: slowest tab 69 ms (65–73) 58 ms (56–61) −16%
…tabs that saw every edit (of 39) 39 39
edit → server holds our heads (40 tabs) 189 ms (181–189) 190 ms (187–196) +0%
…server confirmed every edit (40 tabs) ok ok
…longest main-thread stall in tab 0 during the edits 49 ms (39–51) 41 ms (33–43) −18%
sync rounds per sibling edit, non-editing tab 0 0
server bytes received per edit per tab – –
storage writes (saveBatch) per edit per tab – –
worker errors (40 tabs) 0 0
a fresh tab finds a closed tab's doc (no server) ok ok
…time to find it, from storage 35 ms (35–45) 32 ms (28–37) −9%
…and every edit made before the close is in it ok ok
edits from tabs closed right after editing all survive ok ok
…or at least 5s later ok ok
find a doc another tab just created 48 ms (44–58) 52 ms (50–55) +10%
…and every such find() succeeded within 5s ok ok
…and none settled unavailable first ok ok
edit → seen in 2 other tabs 5 ms (5–5) 5 ms (5–6) +7%
…every edit reached every other tab within 5s ok ok
edit → server holds our heads 123 ms (123–133) 133 ms (133–143) +8%
…the server confirmed every edit within 5s ok 2/3 ok fails 1 of 3
…and a stranger gets the whole doc from the server ok ok
renderer memory, 1 tab 401 MB (401–404) 402 MB (401–402) +0%
renderer memory, 10 tabs 1879 MB (1876–1906) 1882 MB (1861–1914) +0%

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🪡 Patchwork

Torn down.

Comment thread .github/workflows/e2e.yml Fixed
Comment thread .github/workflows/e2e.yml Fixed
chee and others added 2 commits October 22, 2026 23:16
main's pinned-path caching changed automerge-protocol-handler-worker.ts, whose
code now lives in automerge-protocol-handler.ts; the change is carried there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@chee
chee marked this pull request as ready for review October 22, 2026 23:17
@chee
chee merged commit 3d2d0b0 into main Oct 23, 2026
10 checks passed
@chee
chee deleted the lockwait branch October 23, 2026 01:11
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.

2 participants