Make saves follow the nodes they touch, and timeline creation linear
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
A save reads the tree nodes it needs in one query. That query walked from the root once per key; now the keys descend together, each node splitting those that reach it between its children, so each node on the paths is read once and keys are cast once. Appended log moments share nearly their whole path. Comparisons in the trees parse each node's and key's time once. Starting a timeline's saved history (on creation) copied each page of entities by looking each one up again by key; durations are looked up by an expression the planner does not use before a new timeline's statistics count its rows, so each lookup read every duration: quadratic, about 96 minutes to create a million-moment timeline. Each page is now copied by the statement that reads it. The log importer's and syslog receiver's writer splits batches to an adaptive size per timeline: a save taking 8 s or more, or one the server stopped as too slow (now 503 rather than 500), halves the next ones, and quick full saves let them grow back. bench/save-size.mjs measures saves against timeline size. At a million moments, appending 5,000 moments takes 5.2 s (21-25 s before), and creating the timeline 636 s (about 96 minutes before). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/commit/e7023e263265267d086014658d9d34f05eb7fc9f
Open Make saves follow the nodes they touch, and timeline creation linear in the timeline