perf(minifier): prealloc template exprs vec#13410
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #13410 will not alter performanceComparing Summary
Footnotes |
d4fdfa6 to
5ab6573
Compare
294ba18 to
010245a
Compare
010245a to
ddf50ce
Compare
5ab6573 to
7edfe6b
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds a small preallocation optimization to the minifier by preallocating the template expressions vector with the known capacity. The change reduces memory reallocations during template literal processing.
- Preallocates the
expressionsvector withexpression_countcapacity instead of starting with an empty vector
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tasks/track_memory_allocations/allocs_minifier.snap | Updates allocation tracking snapshot showing reduced arena reallocations from 70354 to 70117 |
| crates/oxc_minifier/src/peephole/replace_known_methods.rs | Preallocates expressions vector with known capacity in template literal optimization |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
Small preallocation optimization. Found this mainly to demonstrate that the minifier allocation tracking is working as expected.
7edfe6b to
60dd9c9
Compare

Small preallocation optimization. Found this mainly to demonstrate that the minifier allocation tracking is working as expected.