Skip to content

perf(fmt): reuse parent context in batch ignore matching - #593

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fmt-batch-parent-context
Oct 26, 2026
Merged

chenjiahan merged 1 commit into
mainfrom
chenjiahan/fmt-batch-parent-context

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Motivation

Batch ignore matching repeats ancestor-source lookups, parent-directory checks, and path-prefix construction for each entry in the same directory.

Changes

Reuse the applicable ignore sources, parent state, and path prefixes across each batch. Share rule evaluation and directory caching between individual and batch matches, and extend regression coverage for nested negation and cache invalidation after source updates.

Local measurements on a 56,631-file monorepo, using Node.js 22.16.0, 8 workers, no formatter cache, identical JS snapshots, and release native builds:

Median Before After
Native call replay 167.43 ms 151.60 ms
File discovery 355.35 ms 362.14 ms
Full format check 16.67 s 16.86 s

Native replay improved by 9.5%. File discovery and full checks showed no consistent improvement; the full check was faster in 3 of 6 rounds. Measurements exclude warmups and interleave variants: 18 native replay rounds, 12 fresh-process discovery runs, and 6 fresh-process full checks per variant. File/configuration hashes and diagnostics matched.

Validation: Rust formatting, Clippy, workspace tests, JS/native builds, and Rstack tests passed. A temporary differential harness also found no mismatches against the previous implementation across 2,164,583 comparisons.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T02:57:04.246933Z e79ac9c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: e79ac9c
Status: ✅  Deploy successful!
Preview URL: https://b037d7a7.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-fmt-batch-parent.rstack-cli.pages.dev

View logs

@chenjiahan
chenjiahan merged commit acf1f1e into main Oct 26, 2026
5 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/fmt-batch-parent-context branch October 26, 2026 02:59
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