Skip to content

[trees] Perf | Overhaul path-store startup hot path#494

Merged
SlexAxton merged 1 commit intomainfrom
autoresearch/pathstore-visible-rows-ready/01-startup-hot-path
Apr 10, 2026
Merged

[trees] Perf | Overhaul path-store startup hot path#494
SlexAxton merged 1 commit intomainfrom
autoresearch/pathstore-visible-rows-ready/01-startup-hot-path

Conversation

@SlexAxton
Copy link
Copy Markdown
Contributor

Reduce whole-tree startup work across the path-store tree controller and store setup. This combines the kept changes that removed duplicate controller metadata passes, made projection data lazy/partial, deferred child lookup maps, optimized initial expansion handling, and added file-only builder fast paths for the profile workload.

Experiments: #2, #3, #4, #5, #7, #8, #9, #10, #11, #12, #13, #14, #21, #23, #28, #29
Metric: visible_rows_ready_ms 1002.3 → 197.5 (-80.3%)

Reduce whole-tree startup work across the path-store tree controller and store setup. This combines the kept changes that removed duplicate controller metadata passes, made projection data lazy/partial, deferred child lookup maps, optimized initial expansion handling, and added file-only builder fast paths for the profile workload.

Experiments: #2, #3, #4, #5, #7, #8, #9, #10, #11, #12, #13, #14, #21, #23, #28, #29
Metric: visible_rows_ready_ms 1002.3 → 197.5 (-80.3%)
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

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

Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Apr 10, 2026 2:51am
pierrejs-docs Ready Ready Preview Apr 10, 2026 2:51am

Request Review

@SlexAxton SlexAxton merged commit f83975d into main Apr 10, 2026
10 checks passed
@SlexAxton SlexAxton deleted the autoresearch/pathstore-visible-rows-ready/01-startup-hot-path branch April 10, 2026 02:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e06b9a8aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +927 to +930
previousChildOffsets.length = resolvedDepth;
previousNodeIds.length = resolvedDepth;
if (!foundDirectory) {
continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reset shared-depth cache after unresolved expansion path

In initializeExpandedPaths, unresolved entries (!foundDirectory) still persist previousNodeIds/previousChildOffsets state before continue, so the next path may reuse sharedDepth and skip expanding ancestors that were never expanded. This causes valid later entries to be partially ignored when preceded by a stale/invalid path; for example, with paths = ['a/cab/c/c.ts'] and initialExpandedPaths = ['a/b/abc.ts', 'a/cab/c'], the store leaves a/cab/ and a/cab/c/ collapsed even though a/cab/c is valid.

Useful? React with 👍 / 👎.

Comment on lines +556 to +559
const setSizeByIndex = new Int32Array(rowCount);
for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
setSizeByIndex[rowIndex] = childCount[parentRowIndex[rowIndex] + 1] ?? 0;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compute setSize from full sibling counts when projection is capped

When maxRows truncates projection generation, setSizeByIndex is computed from childCount that only includes visited rows, so sibling counts are understated for early rows. This leaks into tree ARIA metadata during startup (the controller requests a capped projection), e.g. with 1000 visible root items and maxRows=512, the first row reports setSize=512 instead of 1000.

Useful? React with 👍 / 👎.

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