Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents with thousands of historical peer IDs can stall on small concurrent imports. We encountered this during collaborative editing: the first import was quick, but subsequent causally independent updates spent seconds traversing mostly unrelated history. This reproduces on unpatched loro-crdt 1.17.0.
The patch reuses the maintained frontier for the current version, removes multiple frontier candidates per ancestor traversal, and skips unrelated container changes before materializing replay version vectors. It preserves replay-base selection, causal context, and the fallible APIs in 1.17.0.
Performance
Measured the exact reproduction below (4,999 historical map commits from distinct peer IDs, four concurrent updates) with Bun, using identical release-build tooling for unpatched 1.17.0 (
d2f3dfb9) and the patched build. Medians of three alternating fresh-process runs per build, after one excluded warm-up each; separate verified WASM binaries.The fourth movable-list import dropped from 5,220.04 ms to 17.57 ms (297×). First imports were broadly unchanged. These are local reproduction timings, not end-to-end server throughput measurements.
MovableList tracker rebuilds also benefit from filtering unrelated container history before constructing version vectors; the frontier optimizations are shared across types. With 16 concurrent movable-list updates, total import time fell from 149.6 s to 320 ms (467×), and the 16th import from 16.75 s to 21.70 ms (772×) (medians of three runs, same 5,000-history setup).
Reproduction
Validation
loro-internal,loro,loro-wasm,examples,fuzz, andjson-float-consumer, withtest_utils,jsonpath.