Perf: open a note with a long history without replaying every edit #390

Open
opened 2026-10-15 02:10:56 +00:00 by kayg · 0 comments
Owner

Found while working on #44. To open a note, its room replays every edit since the note was created: 5,000 edits take about 11 ms, 20,000 take about 52 ms (locally). The perf fixture doesn't have this, but long-lived daily notes and journals will.

Fix: write a snapshot into history every N edits (or every so many bytes) and replay only from the newest snapshot. Target: opening any note p95 < 5 ms no matter how long its history is.

Sequenced after #298 (group commit / storage stalls), because this touches the same history code. Bench: add a long-history fixture to the perf harness (20k and 100k edits on one note).

Found while working on #44. To open a note, its room replays every edit since the note was created: 5,000 edits take about 11 ms, 20,000 take about 52 ms (locally). The perf fixture doesn't have this, but long-lived daily notes and journals will. Fix: write a snapshot into history every N edits (or every so many bytes) and replay only from the newest snapshot. Target: opening any note p95 < 5 ms no matter how long its history is. Sequenced after #298 (group commit / storage stalls), because this touches the same history code. Bench: add a long-history fixture to the perf harness (20k and 100k edits on one note).
Sign in to join this conversation.
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#390
No description provided.