Repository navigation
perf(@angular/build): bypass worker dispatch for files without transform candidates - #33986
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.
7221f95 to
108bd2a
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.