Skip to content

Slice the tree hydration across frames - #7

Merged
anishshobithps merged 1 commit into
mainfrom
perf/slice-hydration
Nov 10, 2026
Merged

anishshobithps merged 1 commit into
mainfrom
perf/slice-hydration

Conversation

@anishshobithps

Copy link
Copy Markdown
Contributor

Summary

  • The first hydration of a very large tree built every entry in a single frame (about 15 to 40 ms for 50,000 files on its own, more with the rest of the apply).
  • The tree model now supports a staged load: entries are created into a separate map in slices of 8,192 and swapped in by one commit, so the tree on screen never shows a partial or empty state.
  • applyBatch is async. It prepares the tree across frames, then hydrates the session and history stores and commits the tree in the same synchronous step, in the original order. Live batches without a table take the same path with no extra frames.
  • Small tables load in a single step without yielding.

Measured

Production build against the fixture big session (50,001 files), three loads:

  • Tree load: 7 slices of 2.5 to 12 ms each, the commit under 1 ms.
  • No long tasks in two warm loads. The first load after a server start showed three (73, 174 and 63 ms) that I did not attribute; they are not the tree slices.
  • The demo session still goes live and applies live batches.

Test plan

  • turbo run check-types lint
  • 242 tests (5 new: staged model load, store prepareLoad, slicing across frames, single publish, small table without yielding)
  • Browser check on big and demo
  • CI

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
website-vw4l Ready Ready Preview Nov 10, 2026 3:32pm UTC

@anishshobithps
anishshobithps merged commit eb5ce54 into main Nov 10, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview – website-vw4l — 0aa81a2b Deployed Nov 10, 2026 by vercel[bot]
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