Skip to content

perf(allocator): increase initial chunk size from 512B to 16KB#20968

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/04-02-perf_allocator_increase_initial_chunk_size_from_512b_to_16kb
Apr 2, 2026
Merged

perf(allocator): increase initial chunk size from 512B to 16KB#20968
graphite-app[bot] merged 1 commit intomainfrom
om/04-02-perf_allocator_increase_initial_chunk_size_from_512b_to_16kb

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 2, 2026

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.

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 2, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Apr 2, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 2, 2026

Merging this PR will degrade performance by 7.1%

❌ 1 regressed benchmark
✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation mangler[RadixUIAdoptionSection.jsx_keep_names] 18.5 µs 19.9 µs -7.1%

Comparing om/04-02-perf_allocator_increase_initial_chunk_size_from_512b_to_16kb (cdaac4a) with om/04-02-perf_allocator_add_cold_to_to_error_handling_functions (f341b81)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel marked this pull request as ready for review April 2, 2026 13:53
Copilot AI review requested due to automatic review settings April 2, 2026 13:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_capacity so Bump::with_capacity(n) doesn’t allocate the new 16KiB default when n is 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.

@overlookmotel overlookmotel force-pushed the om/04-02-perf_allocator_add_cold_to_to_error_handling_functions branch from 59ab6d8 to f341b81 Compare April 2, 2026 14:55
@overlookmotel overlookmotel force-pushed the om/04-02-perf_allocator_increase_initial_chunk_size_from_512b_to_16kb branch from b997217 to cdaac4a Compare April 2, 2026 14:55
@overlookmotel overlookmotel self-assigned this Apr 2, 2026
@overlookmotel overlookmotel added the A-allocator Area - Allocator label Apr 2, 2026
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Apr 2, 2026 — with Graphite App
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Apr 2, 2026

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.
@graphite-app graphite-app bot force-pushed the om/04-02-perf_allocator_add_cold_to_to_error_handling_functions branch from f341b81 to cbc0c21 Compare April 2, 2026 15:11
@graphite-app graphite-app bot force-pushed the om/04-02-perf_allocator_increase_initial_chunk_size_from_512b_to_16kb branch from cdaac4a to 91cf105 Compare April 2, 2026 15:12
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 2, 2026
Base automatically changed from om/04-02-perf_allocator_add_cold_to_to_error_handling_functions to main April 2, 2026 15:18
@graphite-app graphite-app bot merged commit 91cf105 into main Apr 2, 2026
28 checks passed
@graphite-app graphite-app bot deleted the om/04-02-perf_allocator_increase_initial_chunk_size_from_512b_to_16kb branch April 2, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants