perf(minifier): use Vec::with_capacity for inline template expressions#20389
Merged
graphite-app[bot] merged 1 commit intomainfrom Mar 15, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves minifier peephole performance by avoiding incremental reallocations when collecting inline-able template literal expressions during constant folding.
Changes:
- Pre-allocates
inline_exprswithVec::with_capacity(t.expressions.len())ininline_template_literal.
You can also share your feedback on Copilot code review. Take the survey.
Merging this PR will not alter performance
Comparing Footnotes
|
Member
Author
Merge activity
|
#20389) ## Summary - Pre-allocate `inline_exprs` Vec based on `t.expressions.len()` to avoid incremental reallocations 🤖 Generated with [Claude Code](https://claude.com/claude-code)
6b4377d to
690ce17
Compare
camc314
pushed a commit
that referenced
this pull request
Mar 16, 2026
### 🐛 Bug Fixes - edb8677 ecmascript: Treat collection constructor with variable arg as side-effectful (#20383) (Dunqing) - 1f65c3f transformer: Emit design:paramtypes when class has static anonymous class expression (#20382) (bab) - fa70d5c transformer: Use implementation signature for design:paramtypes when constructor is overloaded (#20394) (bab) - ed5a7fb parser: Report syntax error for `new super()` (#20384) (Boshen) - e62524d minifier: Treat object spread of getters as having side effects (#20380) (Boshen) - f8fbd6e linter/plugins: Remove `hashbang` property from AST (#20365) (overlookmotel) ### ⚡ Performance - 30a2b0f minifier: Use atom_from_strs_array for template literal concat (#20386) (Boshen) - 690ce17 minifier: Use Vec::with_capacity for inline template expressions (#20389) (Boshen) - 9cd612f linter/plugins: Recycle comment objects (#20362) (overlookmotel) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
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
inline_exprsVec based ont.expressions.len()to avoid incremental reallocations🤖 Generated with Claude Code