Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: memoize encodeChange #480

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nornagon
Copy link
Contributor

@nornagon nornagon commented Apr 2, 2022

This stores the original buffer from which a change was decoded, so that
encodeChange(decodeChange(buf)) === buf. This saves a fairly significant
amount of computation in computeHashGraph, in my test case bringing the time
to compute the hash graph down from 4.5 sec to 3.5 sec.

echarles pushed a commit to datalayer-externals/automerge-classic-arch that referenced this pull request Feb 16, 2023
)

In automerge#480 we fixed an issue where `SeekOp` calculated an incorrect
insertion index on optrees where the only visible ops were on internal
nodes. We forgot to port this fix to `SeekOpWithPatch`, which has almost
the same logic just with additional work done in order to notify an
`OpObserver` of changes. Add a test and fix to `SeekOpWithPatch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant