Apply large patches in place, a slice at a time
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
A patch changing more than an eighth of a timeline rebuilt its whole index from a document in Node. Since saves follow the nodes they touch (#154), in place is the cheaper way at any size that matters: deleting 30,000 of 200,000 moments took 26 s in place against 103 s (and 689 MB) rebuilt, and a rebuild of a million-moment timeline takes about 10 minutes and over 1 GB. Patches now rebuild only when they change more than half of a timeline under 200,000 moments; any other patch is applied in place however large. A large patch is applied a slice of 5,000 changes at a time (slicePatch: moments, then durations, then relationships), each to the timeline as the previous slice left it, as one revision. No statement grows with the patch: retention deleting 200,000 moments of a million-moment timeline a fork reads ran a 29 s statement in one piece (against a 30 s limit), and at most 10 s in slices. The log importer's batches follow the new threshold. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/commit/5f05bd1d0973aaf3db56ff7370d214e13cc3755e
Related
Open Apply large patches in place, a slice at a time in the timeline