Skip to content

Speed up guarded bulk edits and 10k-task hydration - #689

Merged
callumalpass merged 1 commit into
mainfrom
sprint-w11-tasknotes-perf
Nov 28, 2026
Merged

callumalpass merged 1 commit into
mainfrom
sprint-w11-tasknotes-perf

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Refs #602

Exact task reads no longer wait for the trailing UI notification before a bulk edit can capture the next row. Each row still reconciles the index, rereads its current record and validates its task model before submission. A retired read still waits before trying again. Summary decoding resolves field aliases once per model. Single-field groups skip a redundant serialization and recurrence cache hits skip parsing the date range.

Measurements

Base 82f2d881 and head 15a59a34 both use production SDK 0.2.61. Each cell gives median / nearest-rank p95 in milliseconds, five observations per cell. At this sample size p95 is the slowest observation.

10,000-task operation Base cold Head cold Base warm Head warm
Decode summaries 138.11 / 168.16 77.75 / 97.97 132.79 / 143.19 72.34 / 79.57
Repository index / stats 693.38 / 808.29 514.02 / 587.02 1.04 / 1.99 0.72 / 0.77
Bases filter + sort 200.15 / 237.06 172.39 / 198.09 178.20 / 198.06 150.37 / 163.73
Group matches 8.17 / 13.87 4.90 / 6.25 6.63 / 8.62 3.26 / 4.88
Expand recurrence 15.96 / 22.84 12.41 / 17.57 6.96 / 14.80 3.31 / 5.22
Capture 32 bulk edits 7820.43 / 7834.38 37.62 / 55.50 7816.10 / 7828.34 36.19 / 38.27
Read 32 pending titles 1.62 / 1.78 0.79 / 0.99 1.54 / 2.39 0.58 / 0.63
Confirm and reconcile 32 edits 17.03 / 21.79 12.21 / 13.94 20.05 / 21.26 11.19 / 11.41
Chromium open to painted row 2862 / 4441 2654 / 3394 2321 / 3243 2279 / 2594

Median throughput for the cold 32-row operation rose from 4.1 to 851 edits/s. The reduction is consistent with removing 31 separate 250 ms notification waits. Filter/sort, pending-title lookup and the ACK path are comparison measurements. The isolated browser samples overlap, especially on reload.

The Node/Vitest run (Node 22.22.0, AMD EPYC 9B14) opens five fresh MemoryReplica and SDK repository sessions. Each session repeats the workload over the same 10,000 tasks, four custom fields including a legacy spelling, 80 projects, and 2,500 daily or weekly series. Cold index includes initialization and a stats read. Warm index measures a stats read after the index is hydrated and the trailing notification has settled. Bases preview filters and sorts 8,000 matches by title, then groups them into 64 projects. The recurrence range changes across sessions and repeats within each session.

Bulk capture applies the real guarded bulk action to 32 records with SDK confirmations held. The benchmark checks the 32 pending writes, releases them together and waits for both the repository ACK readers and the ledger to drain. These are in-process local-capture and acknowledgement timings. Radio loss, network throughput, process restart and native Core are outside this timing harness.

The Chromium 149.0.7827.55 fixture alternates the order of base and head across five fresh browser contexts per revision. Cold opens a fresh context, warm reloads the same context and opens a fresh fixture repository. Timing starts at the Open button and includes fixture seeding, SDK open, the first visible task row and two animation frames. A Chromium CPU profile on the starting branch showed fixture seeding, hashing, change classification, summary projection and React rendering. This browser measurement does not isolate production SDK mdbase:open:stage:apply; #602 still needs a matched hosted cold-open trace.

Reproduce

Run in the head checkout:

pnpm install --frozen-lockfile
rpnpm run bench:collection-session

To benchmark the same harness on the base, create a separate checkout of 82f2d881, copy benchmarks/collection-session.perf.ts and the single bench:collection-session package script into it, then run the same commands. For Chromium, start pnpm dev:e2e --host 127.0.0.1 --port 4286 in the base checkout and pnpm dev:e2e --host 127.0.0.1 --port 4283 at head. From head run:

node scripts/bench-first-paint.mjs http://127.0.0.1:4286 http://127.0.0.1:4283

Verification

The 0.2.61 benchmark and application typecheck passed. The full coverage suite and desktop Playwright checks are running on this head. Regression coverage exercises an exact read after a peer edit while a notification is pending, local write capture, legacy custom-field spellings, and canonical values on write.

Investigated #544. The offline-shell rewrites landed in #675. Public GETs for both /index.html and /404.html returned 200 HTML without redirects. The pinned SDK owns pairing exchange and sign-in polling. No sign-in code or console suppression is included in this PR.

@callumalpass
callumalpass merged commit 7996852 into main Nov 28, 2026
8 checks passed
@callumalpass
callumalpass deleted the sprint-w11-tasknotes-perf branch November 28, 2026 12:01
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