Skip to content

perf(fmt): add native config matcher batch APIs - #395

Open
chenjiahan wants to merge 1 commit into
mainfrom
chenjiahan/feat-native-config-matcher-batch-api
Open

perf(fmt): add native config matcher batch APIs#395
chenjiahan wants to merge 1 commit into
mainfrom
chenjiahan/feat-native-config-matcher-batch-api

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

This PR adds batch APIs to the private native config ignore matcher so formatter discovery can evaluate sibling paths with fewer JavaScript-to-Rust calls. It supports byte-array batches, 32-entry bit-mask batches, and a single-child helper while preserving independent ignore-source semantics and candidate short-circuiting. Sparse masks visit only the remaining set bits, with Rust and native integration coverage for root handling, high-bit masks, and invalid inputs.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 797b176
Status: ✅  Deploy successful!
Preview URL: https://7e2c3260.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-feat-native-confi.rstack-cli.pages.dev

View logs

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

Copy link
Copy Markdown

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: 797b17652a

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


/// Matches children with nonzero candidate flags and returns one byte per input name.
#[napi]
pub fn is_ignored_batch(

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 Wire the batch APIs into formatter discovery

When rs fmt traverses directories with config.ignorePatterns or --ignore-path, createSourceMatcher still exposes only a per-path predicate backed by matcher.isIgnored, and createTraversalOptions.ignore invokes that predicate separately for every entry. The existing batched traversal path calls GitIgnoreMatcher, not these new IgnoreMatcher methods, so repository-wide production code never reaches this API and the claimed reduction in JavaScript-to-Rust calls does not occur; expose and consume the new batch operations from formatter discovery.

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