Skip to content

perf: use mimalloc as the global allocator on macOS#5431

Open
hansl wants to merge 1 commit into
boa-dev:mainfrom
hansl:macos-fast-allocator
Open

perf: use mimalloc as the global allocator on macOS#5431
hansl wants to merge 1 commit into
boa-dev:mainfrom
hansl:macos-fast-allocator

Conversation

@hansl

@hansl hansl commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The CLI's default fast-allocator feature only installed a fast allocator on x86_64 Linux (jemalloc) and Windows (mimalloc); macOS silently fell back to the system libmalloc. Extend the existing mimalloc arm to cover macOS in both the CLI and the benchmark harness (mimalloc-safe already supports Apple Silicon).

Keeping the benchmarks on a fast allocator on macOS also stops local runs from measuring libmalloc overhead instead of engine work, so results track CI (Linux/jemalloc) far more closely. Measured locally, allocation-heavy workloads improve by up to ~8.6% (closures/create) versus libmalloc, while compute-bound benchmarks are unchanged.

The CLI's default `fast-allocator` feature only installed a fast allocator on x86_64 Linux (jemalloc) and Windows (mimalloc); macOS silently fell back to the system `libmalloc`. Extend the existing mimalloc arm to cover macOS in both the CLI and the benchmark harness (`mimalloc-safe` already supports Apple Silicon).

Keeping the benchmarks on a fast allocator on macOS also stops local runs from measuring `libmalloc` overhead instead of engine work, so results track CI (Linux/jemalloc) far more closely. Measured locally, allocation-heavy workloads improve by up to ~8.6% (closures/create) versus libmalloc, while compute-bound benchmarks are unchanged.
@hansl
hansl requested a review from a team as a code owner July 16, 2026 22:25
@github-actions github-actions Bot added the Waiting On Review Waiting on reviews from the maintainers label Jul 16, 2026
@github-actions github-actions Bot added this to the v1.0.0 milestone Jul 16, 2026
@hansl hansl added C-Benchmark Issues and PRs related to the benchmark subsystem. C-CLI Issues and PRs related to the Boa command line interface. A-Memory PRs and Issues related to the memory management or memory footprint. labels Jul 17, 2026
@github-actions github-actions Bot added the C-Dependencies Pull requests that update a dependency file label Jul 17, 2026
@github-actions

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 53,125 53,125 0
Passed 51,072 51,072 0
Ignored 1,482 1,482 0
Failed 571 571 0
Panics 0 0 0
Conformance 96.14% 96.14% 0.00%

Tested main commit: b562725784a18e55d27ddd9702abac61b36a250d
Tested PR commit: e249781863badda085667a41bf0b4956bf1da283
Compare commits: b562725...e249781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Memory PRs and Issues related to the memory management or memory footprint. C-Benchmark Issues and PRs related to the benchmark subsystem. C-CLI Issues and PRs related to the Boa command line interface. C-Dependencies Pull requests that update a dependency file Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant