Skip to content

Reduce Month calendar, drawer and search latency at 60 and 10,000 tasks - #695

Merged
callumalpass merged 1 commit into
mainfrom
calendar-small-task-performance
Nov 28, 2026
Merged

callumalpass merged 1 commit into
mainfrom
calendar-small-task-performance

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Refs #602

Month now reads each week's available space before writing event bars and overflow buttons. The dropdown keeps its localized accessible name. Calendar date labels reuse the app's existing formatter. The task drawer builds forward lookups only for its own links and attaches its configured CodeMirror editor in one DOM write. Search immediately submits pasted or bulk-inserted text and clears, while individual keystrokes keep their existing debounce.

Chromium results

Baseline cec62131afb077f85ee35b38138f8be6d7a84bcc and candidate d83ce37780ccb46a19540c214b39100cdab01756, both loopback e2e builds. Each cell is median / nearest-rank p95 in milliseconds across 15 paired rounds at each size. At this sample size p95 is the maximum. Build order reversed each round. The first five rounds shared one Chromium process. That process exited before recording the next sample, so the remaining ten rounds each used a fresh Chromium process. All completed rounds are included.

Chromium 149.0.7827.55, 1280 × 800, en-US, UTC, reduced motion, service workers blocked, fixed date 2026-11-04. Cold is the first workflow in a fresh browser context. Warm is a reload in that context followed by the same workflow. The calendar opens after Upcoming. Each interaction includes reaching its DOM target and two animation frames. Both filters insert an entire query with Playwright fill(). These timings cover the demo repository. They do not measure external storage latency or typing character by character.

60 tasks

Interaction Cold baseline Cold candidate Warm baseline Warm candidate
Open Today 620 / 2976 589 / 1213 484 / 1121 484 / 633
Upcoming 172 / 725 174 / 270 161 / 641 171 / 501
Month Calendar 112 / 467 95 / 130 97 / 291 72 / 98
Search browse 47 / 105 32 / 61 32 / 140 32 / 51
Return to Today 94 / 383 80 / 158 80 / 391 80 / 111
Capture and update project count 197 / 581 182 / 332 201 / 806 163 / 291
Choose tag chip 108 / 261 98 / 139 106 / 269 96 / 109
Insert title query 210 / 293 37 / 46 209 / 318 33 / 39
Insert tag query 214 / 336 37 / 39 214 / 276 38 / 40
Open task drawer 128 / 533 111 / 181 112 / 319 96 / 111
Edit, save and reopen 208 / 627 192 / 316 192 / 592 194 / 241
Complete and update project count 45 / 106 44 / 74 41 / 95 42 / 59

10,000 tasks

Interaction Cold baseline Cold candidate Warm baseline Warm candidate
Open Today 1592 / 6059 1591 / 8147 1398 / 5697 1397 / 5305
Upcoming 672 / 3003 668 / 2144 622 / 2453 591 / 2228
Month Calendar 575 / 2288 512 / 1662 531 / 1990 480 / 1071
Search browse 64 / 209 48 / 128 60 / 277 61 / 128
Return to Today 400 / 1544 368 / 1242 369 / 1158 368 / 816
Capture and update project count 702 / 2777 691 / 1922 729 / 3563 696 / 905
Choose tag chip 99 / 318 98 / 298 96 / 733 97 / 158
Insert title query 213 / 334 51 / 89 210 / 517 49 / 65
Insert tag query 211 / 314 47 / 113 214 / 389 46 / 63
Open task drawer 160 / 645 144 / 483 129 / 517 115 / 352
Edit, save and reopen 320 / 1083 275 / 873 306 / 1020 301 / 570
Complete and update project count 97 / 282 94 / 242 97 / 383 97 / 166

At 10,000 tasks, cold Month improved by 63 ms at the median and 626 ms at p95. Warm drawer opening improved by 14 ms at the median and 165 ms at p95. The cold app-open median was within 1 ms, but its p95 rose by 2,088 ms. At 60 tasks, warm Upcoming was 10 ms slower at the median. The tables include these controls and the complete project-count workflows.

Verification

  • rpnpm unit suite passed, 2,381 tests passed and nine skipped. Typecheck, lint, production, self-hosted, e2e and importer builds passed.
  • Calendar polish, Calendar clarity and accessibility passed, 16 desktop cases. Both 390 px Scratchpad pointer cases passed the 44 × 44 minimum box, four-corner hit testing, toggle and full axe scan.
  • Additional Chromium checks resized Month from 1440 × 800 to 1440 × 1600 and back. Both builds reported 9 → 5 → 9 hidden entries at 60 tasks and 1,431 → 1,427 → 1,431 at 10,000. Opening the overflow dialog and pressing Escape restored focus. Scoped axe scans of Month, Search results and the task drawer on the candidate found zero violations at either size.

Reproduce

Use the same machine, Chromium version and two idle loopback ports. From a checkout that has both commits, run the following in Bash. Each round runs serially at both fixture sizes.

scratch=$(mktemp -d)
base=cec62131afb077f85ee35b38138f8be6d7a84bcc
candidate=d83ce37780ccb46a19540c214b39100cdab01756
git worktree add --detach "$scratch/base" "$base"
git worktree add --detach "$scratch/candidate" "$candidate"
for variant in base candidate; do
  (cd "$scratch/$variant" && pnpm install --frozen-lockfile && rpnpm --pull dist run build:e2e) || exit 1
done
(cd "$scratch/base" && exec pnpm exec vite preview --host 127.0.0.1 --port 46231 --strictPort) &
base_server=$!
(cd "$scratch/candidate" && exec pnpm exec vite preview --host 127.0.0.1 --port 46232 --strictPort) &
candidate_server=$!
trap 'kill "$base_server" "$candidate_server" 2>/dev/null || true' EXIT
cd "$scratch/candidate"
before=http://127.0.0.1:46231
after=http://127.0.0.1:46232
for origin in "$before" "$after"; do
  until curl -fsS "$origin" >/dev/null; do sleep 1; done
done
for ((round=0; round<15; round++)); do
  origins=("$before" "$after")
  if (( round % 2 )); then origins=("$after" "$before"); fi
  TASKNOTES_BENCH_ROUNDS=1 TASKNOTES_BENCH_FOCUS=calendar-search \
    node scripts/bench-task-workflow.mjs "${origins[@]}" > "$scratch/round-$round.json" || exit 1
done

For the checks, run rpnpm test, rpnpm run typecheck, rpnpm run lint, rpnpm run build, rpnpm run build:self-hosted and rpnpm run import:build in the candidate checkout. Run these browser checks against its pulled e2e build.

export PLAYWRIGHT_BASE_URL=http://127.0.0.1:46233
export PLAYWRIGHT_WEB_SERVER_COMMAND='pnpm exec vite preview --host 127.0.0.1 --port 46233 --strictPort'
pnpm exec playwright test e2e/calendar-polish.spec.ts e2e/calendar-clarity.spec.ts e2e/accessibility.spec.ts
pnpm exec playwright test --project=mobile e2e/phone.spec.ts -g 'Scratchpad draft checkboxes'

@callumalpass
callumalpass merged commit 50e1522 into main Nov 28, 2026
8 checks passed
@callumalpass
callumalpass deleted the calendar-small-task-performance branch November 28, 2026 16:38
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