First note: its text over plain HTTP, not after the room catches up (#327) #407

Closed
kayg wants to merge 1 commit from issue/327-first-note into dev
Owner

Part of #327. A cold start now paints the first note about half a second sooner.

Why

The boot waterfall (10k Home, Chromium 4x) showed the list painted at about 1.6 s but the note's text only at about 2.3 s. With nothing remembered, Editor.show() previews an empty page and waits for the note's live room: the socket joins, the room joins and the Yjs state catches up. On a cold start that wait is the whole gap. notes.peek (#150) already gives a note's text over plain HTTP, quickly, but it was only used for list neighbours.

What

  • peek.ts: peekNow(id) asks for one note's text at once (and remembers it).
  • Editor.svelte: when nothing is remembered, show() calls peekNow and previews the text the moment it arrives, read-only, unless the note is live already.
  • ready(): an empty page waits for that text only when this device has no copy of the note either. It never waits past the usual 1.5 s catch-up, a click or a key. With a local copy (warm starts), it goes live at once, as before.

No look changes. Same read-only preview, then live behind it, as walking the list (#150).

Numbers (perf/web.sh --grep boot, 10k Home, two interleaved A/B rounds, 3 cold starts each)

before after
Chromium cold start, first note painted (p50) 3017 / 3048 ms 2466 / 2587 ms (−16%)
WebKit cold start, first note painted (p50) 4753 / 3044 ms 2663 / 2583 ms
Chromium warm start, first note (p50) 1142 / 1150 ms 1176 / 1123 ms (unchanged, as designed)

The host was at load 24 during these runs, so absolute numbers are high. The A/B is interleaved.

Verified

  • e2e on chromium-1440, webkit-1440 and chromium-390: editor, switching, day, tabs, served, keyboard and traps specs. 63 passed.
  • bun run check is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Part of #327. A cold start now paints the first note about half a second sooner. ## Why The boot waterfall (10k Home, Chromium 4x) showed the list painted at about 1.6 s but the note's text only at about 2.3 s. With nothing remembered, `Editor.show()` previews an empty page and waits for the note's live room: the socket joins, the room joins and the Yjs state catches up. On a cold start that wait is the whole gap. `notes.peek` (#150) already gives a note's text over plain HTTP, quickly, but it was only used for list neighbours. ## What - `peek.ts`: `peekNow(id)` asks for one note's text at once (and remembers it). - `Editor.svelte`: when nothing is remembered, `show()` calls `peekNow` and previews the text the moment it arrives, read-only, unless the note is live already. - `ready()`: an empty page waits for that text only when this device has no copy of the note either. It never waits past the usual 1.5 s catch-up, a click or a key. With a local copy (warm starts), it goes live at once, as before. No look changes. Same read-only preview, then live behind it, as walking the list (#150). ## Numbers (`perf/web.sh --grep boot`, 10k Home, two interleaved A/B rounds, 3 cold starts each) | | before | after | |---|---:|---:| | Chromium cold start, first note painted (p50) | 3017 / 3048 ms | **2466 / 2587 ms** (−16%) | | WebKit cold start, first note painted (p50) | 4753 / 3044 ms | **2663 / 2583 ms** | | Chromium warm start, first note (p50) | 1142 / 1150 ms | 1176 / 1123 ms (unchanged, as designed) | The host was at load 24 during these runs, so absolute numbers are high. The A/B is interleaved. ## Verified - e2e on chromium-1440, webkit-1440 and chromium-390: editor, switching, day, tabs, served, keyboard and traps specs. 63 passed. - `bun run check` is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
First note: its text over plain HTTP, not after the room catches up (#327)
Some checks failed
CI / server (pull_request) Successful in 26s
CI / rust (pull_request) Successful in 2m2s
CI / web (pull_request) Failing after 46m6s
75bdabe9a6
A note picked with nothing remembered (the first note after a cold start,
a note never near the list) showed an empty page until its live room had
joined and caught up over the socket. It now asks for the text with one
notes.peek at once and shows it the moment it arrives, read-only, as a
walked-to note already does; the live document attaches behind it as
before. An empty page waits for that text only when this device has no
copy of the note either, and never past the usual catch-up wait or a
click or key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

This work is consolidated in PR #508: #508. Closing this superseded PR.

This work is consolidated in PR #508: https://git.kayg.org/kayg/calternal/pulls/508. Closing this superseded PR.
kayg closed this pull request 2026-10-16 17:35:06 +00:00
Some checks failed
CI / server (pull_request) Successful in 26s
CI / rust (pull_request) Successful in 2m2s
CI / web (pull_request) Failing after 46m6s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!407
No description provided.