mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-14 14:22:39 +00:00
The worker checks the document state it was given, which is often one edit behind the interface. It composed that older state into the shared composition cache, replacing the interface thread's composition of the current state, so the next frame composed the edited story again (about 14 ms per edit for a 10-page story). Cache::over makes a cache that uses another cache's compositions of the same state and keeps whatever it composes to itself. The worker checks with one over the interface thread's cache, keeps it for the next check of the same document, and drops it after a minute without jobs. With no active document, the job waiting for a busy worker is dropped, so it no longer keeps a closed document in memory until another document opens.