refactor(allocator): use latest bumpalo as base for Bump#20963
Merged
overlookmotel merged 11 commits intomainfrom Apr 2, 2026
Merged
Conversation
Copied verbatim from commit a47f6d6b7b5fee9c99a285f0de80257a0a982ef3 (2 commits after 3.20.2 release).
Member
Author
This was referenced Apr 2, 2026
Merging this PR will improve performance by 10.09%
Performance Changes
Comparing Footnotes
|
Contributor
There was a problem hiding this comment.
Pull request overview
Refreshes oxc_allocator’s in-repo Bump implementation to closely match the latest upstream bumpalo baseline (including restoring the MIN_ALIGN const parameter), with minimal local adjustments to keep CI green and preserve an auditable divergence trail.
Changes:
- Replace the existing modified
Bumpimplementation with a newer upstream-derived version and reintroduceBump<const MIN_ALIGN: usize = 1>. - Gate public exposure of the
bumpmodule behind atestingfeature so doctests can referenceoxc_allocator::bump::Bumpwithout making it part of the public API in normal builds. - Update allocation tracking snapshot outputs to reflect the allocator behavior changes.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/track_memory_allocations/allocs_semantic.snap | Updates semantic allocation snapshot values/format after allocator changes. |
| tasks/track_memory_allocations/allocs_minifier.snap | Updates minifier allocation snapshot values/format after allocator changes. |
| crates/oxc_allocator/src/lib.rs | Makes bump private by default; exposes it only under feature = "testing" for doctests/tests. |
| crates/oxc_allocator/src/bumpalo_alloc.rs | Syncs allocator API module with upstream-derived version + lint attribute reshuffling. |
| crates/oxc_allocator/src/bump.rs | Major upstream refresh of Bump, adds MIN_ALIGN const generic, alignment-aware fast path adjustments, and new try_* helpers. |
| crates/oxc_allocator/Cargo.toml | Adds testing feature and self dev-dependency to enable doctests/tests with testing. |
| Cargo.lock | Reflects the new self dev-dependency edge for oxc_allocator. |
This was referenced Apr 2, 2026
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 2, 2026
…set` (#20964) Partial revert of #18168. #18168 made a small change to `get_current_chunk_footer_field_offset` (used by `Allocator::from_raw_parts`). That change was correct in the context of the other changes made to `Bump` in that PR, but now that #20963 has rolled back most of those changes, this change needs to be reverted too as it's a potential perf regression with current version of `Bump`.
graphite-app bot
pushed a commit
that referenced
this pull request
Apr 2, 2026
Repeat of #18181. #20963 wiped all changes to `bumpalo_alloc.rs`, going back to a fresh copy of `bumpalo`. Re-apply changes from #18181 which were lost in the process - marking error handling functions as `#[cold]`. This PR differs from #18181 in one minor respect. `new_layout_err` is not marked `#[inline(never)]` in this PR. The function is a no-op (unconditionally returns a ZST), so we do want it inlined, but with the`#[cold]`attribute to hint to compiler that it's a cold path.
graphite-app bot
pushed a commit
that referenced
this pull request
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.
overlookmotel
added a commit
that referenced
this pull request
Apr 2, 2026
#20963 had a test failing on 32-bit platforms. Fix it.
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.

#18168 copied
bumpalo's code forBumpintooxc_allocatorcrate. #18172, #18181, and #18234 made a few improvements to the implementation.However, #18168 removed various things, and altered others. Notably, it removed the
MIN_ALIGNgeneric param, which we definitely want to keep.I'm going to be working on the allocator, and would like to start with a clean slate, beginning with the "known good" implementation of
bumpalo.This PR removes the previous modified
bumpaloimplementation, and copies latest version ofbumpalofrom main branch into the repo. It then makes the absolute minimum changes necessary just to make CI pass.Note: Unlike #18168, this PR keeps all the doctests for
Bump, using a trick of adding the crate to it's owndev-dependencieswithtestingfeature enabled, and exposingBumponly with that feature.This PR is broken into multiple commits, so we have an exact "trail of breadcrumbs" of how we've diverged from
bumpalo. I intend to manually merge this PR, so that record remains on Github (instead of Graphite squashing all the commits).Later PRs in this stack reapply the changes made in #18172, #18181, and #18234 on top of the fresh base implementation. This PR is a small perf regression, but that will be won back once those other changes are reapplied.