perf(allocator): increase initial chunk size from 512B to 16KB#20968
Conversation
Merging this PR will degrade performance by 7.1%
Performance Changes
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
Reapplies previously-lost allocator performance tweaks to oxc_allocator’s bump arena by increasing the default initial chunk size and ensuring with_capacity honors small requested capacities, with updated allocation-tracking snapshots.
Changes:
- Increase the initial arena chunk target (
FIRST_ALLOCATION_GOAL) from 512B to 16KiB to reduce allocator calls. - Update
try_with_min_align_and_capacitysoBump::with_capacity(n)doesn’t allocate the new 16KiB default whennis much smaller. - Refresh internal allocator test expectations and memory-allocation tracking snapshots to match the new behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_allocator/src/bump.rs | Adjusts first-chunk sizing behavior and updates a unit test to reflect deferred allocation on Bump::new(). |
| tasks/track_memory_allocations/allocs_semantic.snap | Updates expected allocation counts for semantic tracking after allocator behavior change. |
| tasks/track_memory_allocations/allocs_minifier.snap | Updates expected allocation counts for minifier tracking after allocator behavior change. |
59ab6d8 to
f341b81
Compare
b997217 to
cdaac4a
Compare
Merge activity
|
Repeat of #18234. #20963 wiped all changes to `bump.rs`, going back to a fresh copy of `bumpalo`. Re-apply changes from #18234 which were lost in the process - increasing default arena chunk size to 16 KiB, and altering `try_with_min_align_and_capacity` to respect the requested capacity in `Bump::with_capacity`. Add a comment to `try_with_min_align_and_capacity` explaining why that change is required.
f341b81 to
cbc0c21
Compare
cdaac4a to
91cf105
Compare

Repeat of #18234.
#20963 wiped all changes to
bump.rs, going back to a fresh copy ofbumpalo.Re-apply changes from #18234 which were lost in the process - increasing default arena chunk size to 16 KiB, and altering
try_with_min_align_and_capacityto respect the requested capacity inBump::with_capacity.Add a comment to
try_with_min_align_and_capacityexplaining why that change is required.