perf(@angular/build): bypass worker dispatch for files without transform candidates - #33986
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a fast-path pre-filter, hasAdvancedOptimizationCandidates, in javascript-transformer.ts to bypass worker dispatch and AST parsing when JavaScript code does not contain candidate constructs for advanced optimizations. The corresponding unit tests are updated and expanded to cover this new bypass logic. The reviewer suggests optimizing the string-matching logic in the pre-filter by using a compiled regular expression instead of multiple sequential includes checks, and adding an additional unit test to verify worker dispatch when decorator tokens are present and sideEffects is false.
…orm candidates Files that require neither Angular linking nor advanced optimizations previously underwent full worker thread IPC dispatch, worker deserialization, and AST processing. By evaluating a fast candidate check on the main thread directly on raw data buffers, files that cannot be modified by advanced optimizations immediately return the original data buffer without worker dispatch or AST parsing.
clydin
force-pushed
the
perf/js-transformer-fast-path
branch
from
September 1, 2026 18:14
7221f95 to
108bd2a
Compare
alan-agius4
approved these changes
Sep 2, 2026
Member
Author
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
Files that require neither Angular linking nor advanced optimizations previously underwent full worker thread IPC dispatch, worker deserialization, and AST processing.
By evaluating a fast candidate check on the main thread directly on raw data buffers, files that cannot be modified by advanced optimizations immediately return the original data buffer without worker dispatch or AST parsing.