oxc-project
oxc
BlogDocsChangelog

refactor(allocator): replace bumpalo with custom bump allocator

#18141Closed
Comparing
refactor/remove-bumpalo
(
51023fa
) with
main
(
38e4b53
)
CodSpeed Performance Gauge
-3%
Regressions
1
Untouched
41
Skipped
3

Benchmarks

Skipped (3)

Failed

mangler[cal.com.tsx]
tasks/benchmark/benches/minifier.rs::minifier::bench_mangler
Regression
CodSpeed Performance Gauge
-3%
2.8 ms2.9 ms

Passed

isolated-declarations[vue-id.ts]
tasks/benchmark/benches/transformer.rs::transformer::bench_isolated_declarations
CodSpeed Performance Gauge
+2%
57 ms55.7 ms
formatter[core.js]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+2%
2 ms2 ms
parser[cal.com.tsx]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
+2%
25.4 ms24.9 ms
parser[binder.ts]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
+2%
3.1 ms3.1 ms
formatter[next.ts]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+2%
2.8 ms2.8 ms
minifier[binder.ts]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
+2%
4.2 ms4.1 ms
minifier[react.development.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
+2%
2.6 ms2.6 ms
formatter[index.tsx]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+2%
4.6 ms4.5 ms
formatter[errors.ts]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+2%
786.8 µs775.1 µs
minifier[cal.com.tsx]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
+2%
37.8 ms37.2 ms
formatter[Search.tsx]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+1%
1.9 ms1.9 ms
parser[react.development.js]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
+1%
1.2 ms1.2 ms
mangler[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/minifier.rs::minifier::bench_mangler
CodSpeed Performance Gauge
+1%
13 µs12.8 µs
transformer[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
+1%
135.1 µs133.4 µs
formatter[handle-comments.js]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+1%
3.5 ms3.5 ms
formatter[App.tsx]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+1%
49 ms48.4 ms
semantic[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
+1%
63 µs62.3 µs
semantic[cal.com.tsx]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
+1%
21.3 ms21.1 ms
formatter[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
+1%
438.9 µs436.5 µs
semantic[react.development.js]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
1.3 ms1.3 ms
formatter[types.ts]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
0%
14.8 ms14.7 ms
semantic[binder.ts]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
3.1 ms3.1 ms
transformer[binder.ts]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
1.7 ms1.7 ms
parser[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
81.1 µs80.9 µs
linter[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
746.2 µs744.7 µs
codegen[cal.com.tsx]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
33.9 ms33.8 ms
linter[react.development.js]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
19.8 ms19.7 ms
lexer[cal.com.tsx]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
5.5 ms5.5 ms
codegen[react.development.js]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
1.9 ms1.9 ms
lexer[binder.ts]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
885 µs885.2 µs
estree[checker.ts]
tasks/benchmark/benches/parser.rs::parser::bench_estree
CodSpeed Performance Gauge
0%
105.1 ms105.1 ms
linter[cal.com.tsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
492.5 ms492.7 ms
linter[binder.ts]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
49.5 ms49.6 ms
codegen[binder.ts]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
4.3 ms4.3 ms
lexer[react.development.js]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
358 µs358.4 µs
transformer[react.development.js]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
721.4 µs722.6 µs
lexer[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
-1%
21.1 µs21.3 µs
transformer[cal.com.tsx]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
-1%
26.4 ms26.6 ms
codegen[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
-2%
120.4 µs122.2 µs
mangler[binder.ts]
tasks/benchmark/benches/minifier.rs::minifier::bench_mangler
CodSpeed Performance Gauge
-2%
702.1 µs714.3 µs
mangler[react.development.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_mangler
CodSpeed Performance Gauge
-2%
251.3 µs256.3 µs

Commits

Click on a commit to change the comparison range
Base
main
38e4b53
-4.16%
fix(allocator): maintain alignment in overaligned allocations When allocating with alignment > 8, we must round the size up to the requested alignment, not just to 8. Otherwise, subtracting the size from an aligned pointer results in a misaligned pointer. This fixes hashbrown SSE2 control group panics which require 16-byte alignment.
09a53a3
15 hours ago
by Boshen
-0.01%
fix(allocator): track allocations and reallocations in allocator_api2 Add tracking calls for allocate/grow/shrink in the allocator_api2 impl. This fixes the reallocation count being 0 in allocation snapshots.
ad99105
15 hours ago
by Boshen
+0.46%
perf(allocator): optimize hot path with wrapping arithmetic Key optimizations: 1. Use usize::MAX sentinel for empty allocator's start pointer - Eliminates null check on hot path 2. Use wrapping_sub instead of checked subtraction - Single comparison (new_ptr >= start) replaces two branches 3. Simplify grow path with same wrapping arithmetic pattern The hot path now has: - 2 loads (ptr, start) - 1 wrapping_sub - 1 comparison (new_ptr >= start && align <= 8) - 1 store Previously had: - 2 loads - 1 null check - 1 subtraction for available space - 2 comparisons (available >= size, align check) - 1 subtraction for new_ptr - 1 store
faf1b5d
15 hours ago
by Boshen
+0.57%
[autofix.ci] apply automated fixes
a9ffe4a
6 hours ago
by autofix-ci[bot]
-10.94%
fix(allocator): maintain alignment in grow() for non-aligned sizes When growing allocations with sizes not aligned to ALIGN (8 bytes), the cursor could become misaligned. For example, a Vec<u8> growing from capacity 3 to 6 would compute additional=3, making the cursor point to an address not divisible by 8. Fix by computing additional as the difference between rounded sizes: additional = round_up_to(new_size, ALIGN) - round_up_to(old_size, ALIGN) Also handle the case where both sizes round to the same value (no additional space needed). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
eae2298
6 hours ago
by Boshen
+11.08%
perf(allocator): increase default chunk size to match bumpalo usable space The DEFAULT_CHUNK_SIZE was 512 bytes total, which left only 464 bytes usable after accounting for the 48-byte footer. Bumpalo's FIRST_ALLOCATION_GOAL is 512 bytes of *usable* space. This 10% difference in initial usable space caused more frequent chunk allocations, which was identified as the source of the performance regression in build_semantic -> alloc_slow -> alloc_chunk. Fix by setting DEFAULT_CHUNK_SIZE = 512 + FOOTER_SIZE, giving us ~512 bytes of usable space like bumpalo. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
e56e2ed
3 hours ago
by Boshen
-0.01%
perf(allocator): remove ineffective `likely` hint and `#[cold]` from Vec grow - Remove `likely()` wrapper function - the `#[cold]` attribute on `alloc_slow` already tells LLVM the slow path is unlikely - Remove `#[cold]` from Vec's inner grow function - for interleaved Vec growth patterns (e.g., in `tally_slot_frequencies`), this path is actually hot, not cold. Keep `#[inline(never)]` to avoid code bloat. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51023fa
3 hours ago
by Boshen
© 2026 CodSpeed Technology
Home Terms Privacy Docs