# perf: page writes in one revision, and saves off the main thread · clo/snowbound

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

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

Visibility: public

Requested revision: e0b4334a77134228b5f773ce7cb9227fc2dd027d

Requested commit: e0b4334a77134228b5f773ce7cb9227fc2dd027d

Commit: e0b4334a77134228b5f773ce7cb9227fc2dd027d

Tree: f4ba24b7af1affa009b2dc066a076ae37687589d

Author: clover caruso

Committer: clover caruso

## Message

```
perf: page writes in one revision, and saves off the main thread

The page writer keeps its step-by-step object placement but simulates
each step's write and read-back in memory, building one revision per
write instead of one per step; output is byte-identical (505 corpus
sections, 8052 page edits, generated pages up to 2000 paragraphs). A
250-paragraph import into a 4.6 MB section drops from 22 s to 0.15 s and
2000 paragraphs from 38 minutes to 0.7 s.

Section::queue_save saves on a thread, chaining consecutive saves of a
page, and saved() reports outcomes; Snowbound saves through it, so an
edit no longer re-reads and rewrites the section on the main thread.

Assisted-by: claude-opus-5.5
Assisted-by: claude-opus-5

```

## Parents

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

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