The logic for condensing multiple inserts was faulty in that it did not
take into account the `insert` flag on the ops that were being
condensed. This led to an issue where multiple set operations on an
object were converted into a multi-insert operation in the patch. This
commit adds a fix and a few tests.
* Use mutationtracker in frontendstate
This allows us to directly track the modified optimistic state and
avoids us having to clone the state when we receive a non-local patch.
* Split mutation tracker from OptimisticStateTree
* Store diffs not whole patches
* Reset the reconciled_root_state when no in_flight_requests
* Document some functions
* Use .. in struct destructuring
* Update docs
* Make some bits more visible
* Add basic proxy with map
* Actually expose the Proxies
* Add more proxies and functionality
* Use &str instead of &SmolStr
* Add some derives
* Add derives to RootProxy
* Add value method
* Add general value method to ValueProxy
* Rename *Proxy to *Ref and update modules
* Format
* Fixup Sequence name
* Use tinyvec for actor id
Most of the time users will not be using their own identifiers and so
use random uuids. These can fit nicely on the stack for a speedup.
TinyVec allows us to capture this mostly stack, sometimes heap
behaviour.
* Use git version of tinyvec for arbitrary
* Flatten object type
* Use separate construct functions
* Use separate gen_*_diff functions
* Remove maptype and seqtype from Diffs
* Preallocate ops in new_map_or_table
* More preallocations
It wasn't really uncompressed as we have compressed and uncompressed
changes in the backend. It is just not encoded into the binary format.
The module separation (protocol vs backend) should help with the
distinction.
This means we can keep things in the original state but while applying
the diff we don't have to keep building a new vec each time.
This makes B1.1 run in ~11 seconds for me.
These were likely used at one point but now just incur an expensive
allocation cost. This reduces the B1.1 Append N characters benchmark
from ~19s to ~16s.