Skip to content

Reduce duplicate work when opening a dense agenda - #691

Merged
callumalpass merged 2 commits into
mainfrom
10k-task-performance-a11y
Nov 28, 2026
Merged

callumalpass merged 2 commits into
mainfrom
10k-task-performance-a11y

Conversation

@callumalpass

@callumalpass callumalpass commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Refs #602

Upcoming now starts with the anchor, configured list length and end of the visible date strip. The strip waits for its actual DOM dates before asking for entries. This removes a speculative pass over the collection and retains the separate overdue-on-today projection. Floating dates in the same synchronous batch share one validated device timezone. A microtask clears it so the next batch picks up device timezone changes.

The agenda also keeps its position when the sidebar settles during initial load. Once someone scrolls into the agenda, changing the pane width still reanchors the selected day. The previous resize handler scrolled a freshly opened desktop agenda by 1,114 px and left controls obscured by its sticky header.

Chromium measurements

Seven paired runs, alternating base and PR order, against local optimized e2e builds of be09772a and 592a3c41. The workflow below ran without concurrent local test jobs from this lane. SDK first-row timings came from separate seven-pair runs for each size. Values are milliseconds from the action through its visible outcome and two animation frames. p95 uses nearest rank (the largest of seven). These are end-to-end browser timings on a shared workstation. The 60-task fixture is a control for browser and machine variation.

Cold uses a fresh Chromium context, warm reloads the fixture in that context and repeats the workflow. Both rebuild their in-memory records. The SDK protocol fixture measures from its Open button, including replica seeding. Demo open includes page navigation. View switches use the app router. Capture and completion wait for the Operations count to change. Edit waits for the new title in a reopened drawer, and drag waits for the moved task in the destination day. All writes use disposable local fixtures.

On the final head, the median 10k Upcoming switch fell from 1,336 to 1,037 ms cold (22%) and from 1,230 to 783 ms warm (36%). Both measurements also improved in the earlier run. The final Upcoming p95 rose from 2,343 to 4,036 ms cold and from 2,045 to 2,726 ms warm. Tail latency varied on the shared host.

Warm drag went from 2,766 to 2,437 ms in the final run, reversing the earlier slowdown. Cold Calendar entry (707 to 781 ms) and warm completion through the project-count update (146 to 202 ms) had higher medians. Search entry was within 1 ms cold and warm. The measured improvement is in median Upcoming entry.

10,000 tasks

Operation (ms) Cold base, p50 / p95 Cold PR, p50 / p95 Warm base, p50 / p95 Warm PR, p50 / p95
SDK fixture open to first task row 623 / 644 615 / 624 555 / 584 549 / 598
Demo open to first task row 1,760 / 3,424 2,448 / 6,806 2,322 / 2,722 1,608 / 5,976
Upcoming 1,336 / 2,343 1,037 / 4,036 1,230 / 2,045 783 / 2,726
Calendar 707 / 1,142 781 / 2,902 630 / 1,004 656 / 2,202
Tasks 208 / 422 255 / 584 216 / 293 192 / 741
Projects 466 / 843 526 / 1,918 460 / 682 483 / 1,530
Kanban 315 / 441 304 / 922 265 / 518 261 / 812
Scratchpad 79 / 114 86 / 240 71 / 95 64 / 228
Search 64 / 96 64 / 134 63 / 91 64 / 176
Today 527 / 721 540 / 1,481 384 / 752 432 / 1,444
capture + project count 959 / 1,375 998 / 3,575 848 / 2,547 832 / 3,862
title filter 215 / 1,218 229 / 1,126 221 / 313 224 / 484
tag filter 218 / 230 215 / 363 236 / 300 214 / 424
open detail 225 / 294 256 / 711 214 / 517 191 / 569
edit, save + reopen 606 / 1,104 567 / 2,543 524 / 1,421 503 / 1,187
complete + project count 147 / 228 159 / 457 146 / 330 202 / 222
agenda scroll 234 / 305 290 / 564 232 / 389 219 / 341
agenda drag 2,481 / 3,617 2,321 / 9,104 2,766 / 5,251 2,437 / 3,489

60 tasks

Operation (ms) Cold base, p50 / p95 Cold PR, p50 / p95 Warm base, p50 / p95 Warm PR, p50 / p95
SDK fixture open to first task row 1,212 / 2,043 1,073 / 2,111 864 / 1,804 835 / 891
Demo open to first task row 593 / 1,952 655 / 931 481 / 1,639 465 / 1,030
Upcoming 234 / 1,239 176 / 376 219 / 881 129 / 451
Calendar 128 / 1,033 96 / 209 111 / 492 115 / 336
Tasks 48 / 196 48 / 79 52 / 217 50 / 108
Projects 81 / 384 80 / 128 94 / 276 64 / 261
Kanban 98 / 514 96 / 195 96 / 273 81 / 237
Scratchpad 74 / 409 76 / 96 61 / 223 58 / 82
Search 48 / 140 52 / 62 46 / 87 45 / 76
Today 93 / 513 96 / 149 99 / 244 80 / 117
capture + project count 411 / 1,216 324 / 551 351 / 1,043 349 / 526
title filter 216 / 290 223 / 305 216 / 274 199 / 230
tag filter 213 / 318 216 / 223 214 / 260 210 / 242
open detail 160 / 963 160 / 236 160 / 1,491 163 / 303
edit, save + reopen 252 / 2,040 256 / 464 240 / 765 275 / 1,439
complete + project count 45 / 431 54 / 81 46 / 136 48 / 78
agenda scroll 100 / 720 60 / 381 63 / 604 60 / 86
agenda drag 834 / 3,317 906 / 1,302 791 / 2,471 818 / 2,002
Earlier shared-host run (seven paired workflows)

The application source was identical. This harness took pointer coordinates before dragging. The final harness waits for actionable source and destination elements. Both verify the moved task in the destination day. Some earlier rounds overlapped local accessibility tests. One incomplete pair ended in a renderer crash and was discarded. The first attempt to repeat the workflow also exposed a stale coordinate read after the date strip rerendered. Both tables use complete pairs only.

10,000 tasks

Operation (ms) Cold base, p50 / p95 Cold PR, p50 / p95 Warm base, p50 / p95 Warm PR, p50 / p95
Demo open to first task row 5,687 / 9,451 4,917 / 7,978 5,018 / 12,715 4,856 / 7,952
Upcoming 3,322 / 5,864 2,308 / 3,262 3,555 / 7,559 1,700 / 3,387
Calendar 1,439 / 2,756 1,644 / 3,704 1,848 / 3,181 1,410 / 3,527
Tasks 542 / 722 558 / 1,195 613 / 1,063 542 / 902
Projects 1,151 / 1,489 1,150 / 2,470 1,318 / 1,853 1,194 / 1,843
Kanban 671 / 1,052 611 / 1,488 788 / 2,147 778 / 1,209
Scratchpad 161 / 284 158 / 550 136 / 268 136 / 244
Search 96 / 166 113 / 571 176 / 644 184 / 265
Today 912 / 1,512 929 / 2,576 1,323 / 3,162 1,139 / 1,929
capture + project count 1,839 / 3,359 1,594 / 4,805 2,125 / 4,245 2,467 / 5,224
title filter 275 / 385 263 / 315 282 / 411 312 / 800
tag filter 248 / 464 247 / 414 293 / 394 309 / 615
open detail 407 / 799 436 / 1,887 448 / 812 460 / 2,796
edit, save + reopen 905 / 2,146 1,094 / 3,014 1,139 / 2,085 1,119 / 4,410
complete + project count 287 / 543 302 / 666 330 / 498 443 / 1,110
agenda scroll 593 / 1,218 296 / 2,078 458 / 1,409 547 / 964
agenda drag 4,739 / 14,533 4,144 / 10,463 3,898 / 12,662 5,586 / 12,074

60 tasks

Operation (ms) Cold base, p50 / p95 Cold PR, p50 / p95 Warm base, p50 / p95 Warm PR, p50 / p95
Demo open to first task row 2,634 / 4,381 1,049 / 1,943 1,299 / 1,872 812 / 1,850
Upcoming 917 / 1,298 414 / 550 601 / 1,203 347 / 700
Calendar 515 / 1,415 277 / 387 367 / 649 180 / 671
Tasks 177 / 514 79 / 104 132 / 905 82 / 156
Projects 399 / 1,016 221 / 258 247 / 444 181 / 487
Kanban 378 / 516 202 / 356 372 / 582 181 / 519
Scratchpad 217 / 340 147 / 261 131 / 352 112 / 149
Search 128 / 217 121 / 148 99 / 199 86 / 123
Today 358 / 968 232 / 463 335 / 706 173 / 431
capture + project count 1,000 / 1,541 924 / 1,135 946 / 3,308 582 / 1,723
title filter 282 / 390 273 / 330 326 / 648 241 / 380
tag filter 286 / 412 245 / 315 297 / 498 227 / 399
open detail 444 / 737 329 / 715 465 / 791 316 / 573
edit, save + reopen 774 / 1,487 618 / 1,537 1,050 / 2,561 548 / 1,123
complete + project count 135 / 297 71 / 113 91 / 259 59 / 141
agenda scroll 158 / 463 93 / 203 86 / 906 71 / 138
agenda drag 2,556 / 3,396 1,589 / 3,412 2,103 / 4,370 1,344 / 3,588

Correctness and accessibility

  • Full unit suite passed (2,374 tests, 9 skipped). Format, typecheck, lint, production build and e2e build passed. Lint reported 13 warnings.
  • On the base, 6/12 dense-agenda repeats expired at the five-second first-row assertion. The test now waits for a real task in the first virtual row group, gives cold admission 30 seconds and uses the same 90-second total budget as the dense Projects test. All 12 candidate repeats passed with zero retries, including focus, row bounds, counts, collapse and axe.
  • Chromium 149.0.7827.55, local demo, UTC on 2026-11-04. Axe found zero WCAG A/AA violations across 36 scans covering Today, Upcoming, Tasks, task details, Projects, Kanban, Calendar, Scratchpad and Search at 390×844 and 1280×800, each in light and dark. The baseline reported partially obscured targets in desktop Upcoming in both themes. With the resize fix, all four Upcoming scans passed.
  • Native, LAB and production behavior remain unverified by this local run.

Reproduction

In separate worktrees at the base and PR revisions, run rpnpm --pull dist run build:e2e. Serve the built directories on loopback with pnpm exec vite preview --host 127.0.0.1 --port 4773 --strictPort for the base and port 4774 for the PR. Run the PR's harness for both origins.

node scripts/bench-task-workflow.mjs http://127.0.0.1:4773 http://127.0.0.1:4774
for size in 60 10000; do
  TASKNOTES_BENCH_TASKS=$size node scripts/bench-first-paint.mjs http://127.0.0.1:4773 http://127.0.0.1:4774
done
PLAYWRIGHT_BASE_URL=http://127.0.0.1:4775 \
  PLAYWRIGHT_WEB_SERVER_COMMAND='pnpm exec vite preview --host 127.0.0.1 --port 4775 --strictPort' \
  pnpm exec playwright test e2e/agenda-window.spec.ts --project desktop --workers 1 --repeat-each 12 --retries 0

@callumalpass
callumalpass merged commit cd1596b into main Nov 28, 2026
9 of 10 checks passed
@callumalpass
callumalpass deleted the 10k-task-performance-a11y branch November 28, 2026 14:00
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