# perf: parse a section once per side when saving; store the working image as a patch · clo/snowbound

[View on GitCafe](https://git.cafe/clo/snowbound/commit/be6b82da9a9e19b3a47c24655949fd2d66db0800)

Repository: [clo/snowbound](https://git.cafe/clo/snowbound)

Visibility: public

Requested revision: be6b82da9a9e19b3a47c24655949fd2d66db0800

Requested commit: be6b82da9a9e19b3a47c24655949fd2d66db0800

Commit: be6b82da9a9e19b3a47c24655949fd2d66db0800

Tree: afe4c81369cdf10faf1f1ddb8aff5d220f73bacb

Author: clover caruso

Committer: clover caruso

## Message

```
perf: parse a section once per side when saving; store the working image as a patch

A page save parsed the section about twenty times with up to four parsed copies
alive: the lowering re-read the unchanged page before every writer pass, the
write path parsed and validated the source its caller had just parsed and
validated, and squash kept both parsed images alive while checking the result.
The lowered page is now cached until a writer changes the image, typed writers
hand their validated index to the write layer, parsed sources are released
before results are checked, GUID tables are built once from a sorted list and
node lists drop their slack.

The cache stored base and working whole in one row, so every save rewrote twice
the section and every idle poll parsed, validated and rewrote both. working is
now the byte ranges where it differs from base (schema 14) and an unchanged
remote is recognised by comparison alone.

Owner 12 MiB section: 141 ms / +65 MiB to 65 ms / +29 MiB per save. 24 MiB soak
section: 780 ms / +506 MiB to 310 ms / +154 MiB; launch with two publications
7.3 s to 2.7 s; cache half the size.

Assisted-by: claude-fable-5.1

```

## Parents

- [3d0dd98f39482111b7e2e32734d71bc806d826c8](https://git.cafe/clo/snowbound/commit/3d0dd98f39482111b7e2e32734d71bc806d826c8?format=markdown)

[Source at this commit](https://git.cafe/clo/snowbound/tree/be6b82da9a9e19b3a47c24655949fd2d66db0800?format=markdown)
