Repository navigation
perf(rsbuild): skip ordinary RPC source masking - #861
Merged
Merged
Conversation
jonkwheeler
marked this pull request as ready for review
August 26, 2026 14:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
module servercandidate@octanejs/rsbuild-pluginWhy
Rsbuild's RPC owner discovery scans every project
.tsxand.tsrxfile. The common no-owner path split each entire source into a character array, rewrote it, and joined it again only to prove thatmodule serverwas absent.On a synthetic 32 MiB project of 256 ordinary components, the same seven-sample harness improved from a 332.6 ms median to 25.4 ms (92.4% lower, 13.1x faster). A control where every file contained both words still took 341.2 ms, confirming that candidate validation was not skipped or made artificially faster.
Changes
Validation
pnpm format:check(targeted Prettier check passed for both changed files)pnpm typecheck(tsgo --noEmit -p packages/rsbuild-plugin-octane/tsconfig.typecheck.jsonpassed)pnpm test(targeted Rsbuild validation used instead)pnpm syncRisk / follow-ups
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Performance-only early return in discovery; candidate detection behavior stays the same when both tokens are present.
Overview
Rsbuild RPC owner discovery now bails out of
ownsServerModulewith cheapincludeschecks formoduleandserverbefore runningmaskNonCodeand server compilation on every scanned.tsx/.tsrxfile.Files that lack both substrings skip the allocation-heavy character-array masking path entirely. When both appear—including comment-separated
module servercandidates—the existing mask, regex gate, and compiler validation still run unchanged.A patch changeset records the build-time improvement for
@octanejs/rsbuild-plugin.Reviewed by Cursor Bugbot for commit 173bd20. Bugbot is set up for automated code reviews on this repo. Configure here.