Skip to content

fix(core): avoid double mirror startup traversal#86

Open
zxch3n wants to merge 2 commits into
mainfrom
codex/avoid-startup-double-snapshot
Open

fix(core): avoid double mirror startup traversal#86
zxch3n wants to merge 2 commits into
mainfrom
codex/avoid-startup-double-snapshot

Conversation

@zxch3n

@zxch3n zxch3n commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

  • avoid building the root mirror snapshot twice during construction
  • register nested map/list containers while walking the startup snapshot instead of doing a separate nested scan first
  • keep tree startup registration on the existing nested scan path

Validation

  • pnpm --filter loro-mirror test
  • pnpm check
  • git diff --check

Trace note

The Lody trace shows the long startup task split between initializeContainers and buildRootStateSnapshot. This change removes that duplicate map/list traversal. Local Node + loro-crdt/web benchmarks on the provided updates.json still stay in the tens of milliseconds, so this fixes the clear duplicate work but does not by itself explain the full multi-second Chrome trace.

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.

1 participant