perf(mangler): replace FixedBitSet with BitSet based on Rolldown's implementation#13419
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 #13419 will degrade performances by 17.18%Comparing Summary
Benchmarks breakdown
Footnotes |
4db95f0 to
32827de
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the external FixedBitSet dependency with a custom BitSet implementation based on Rolldown's implementation to improve performance in the mangler. The custom implementation uses the allocator for memory management.
- Removes the
fixedbitsetdependency and implements a customBitSetstruct - Updates mangler code to use the new
BitSetAPI methods (has_bit,set_bit) - Integrates the new
BitSetwith the existing allocator system for better memory management
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_mangler/src/lib.rs | Updates imports and replaces FixedBitSet usage with custom BitSet |
| crates/oxc_mangler/src/bitset.rs | Adds new custom BitSet implementation with allocator support |
| crates/oxc_mangler/Cargo.toml | Removes fixedbitset dependency |
| Cargo.toml | Removes fixedbitset from workspace dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
32827de to
e473b83
Compare
#13419 introduced a `BitSet` type which stores its data in the arena, in the mangler. This type may be useful in other contexts, so move it from `oxc_mangler` into `oxc_allocator`. But put it behind a `bitset` feature, so only crates which use it pay for it.

Just recalled that there's a bitset implementation in rolldown that is not complicated. I've copied that and change it to use the allocator. This might work?
refs #11347