Context: currently we store a mapping from ChangeHash -> Clock, where `Clock` is the set of (ActorId, (Sequence number, max Op)) pairs derived from the given change and it's dependencies. This clock is used to determine what operations are visible at a given set of heads. Problem: populating this mapping for documents with large histories containing many actors can be very slow as for each change we have to allocate and merge a bunch of hashmaps. Solution: instead of creating the clocks on load, create an adjacency list based representation of the change graph and then derive the clock from this graph when it is needed. Traversing even large graphs is still almost as fast as looking up the clock in a hashmap. |
||
---|---|---|
.. | ||
benches | ||
examples | ||
fuzz | ||
src | ||
tests | ||
.gitignore | ||
Cargo.toml | ||
README.md |
Automerge
Automerge is a library of data structures for building collaborative local-first applications. This is the Rust implementation. See automerge.org