rust icon indicating copy to clipboard operation
rust copied to clipboard

Use `mimalloc` as `global_allocator` for `rustc_driver`

Open Zoxc opened this issue 2 years ago • 9 comments

This changes the Rust global allocator for rustc_driver to mimalloc, leaving LLVM unaffected.

Based on https://github.com/rust-lang/rust/pull/122362.

Zoxc avatar Mar 12 '24 08:03 Zoxc

r? @lcnr

rustbot has assigned @lcnr. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Mar 12 '24 08:03 rustbot

Has anything changed since we last evaluated mimalloc and decided we wouldn't use it over jemalloc on linux?

lqd avatar Mar 12 '24 09:03 lqd

I'd like to see the memory use of a mimalloc + jemalloc mix.

Zoxc avatar Mar 12 '24 10:03 Zoxc

Ok then we can wait another hour for #122362's results in case there's an issue there, and then trigger a run for this PR. I'm not sure what code will get mimalloc vs jemalloc's symbol overrides (if any) but we'll see.

In the meantime:

@bors try

lqd avatar Mar 12 '24 12:03 lqd

:hourglass: Trying commit 3482094f6776ea94eeb971791473f3a6440e5ba0 with merge 7c1e66778214e445126667614fe1d6a72eb7d2ea...

bors avatar Mar 12 '24 12:03 bors

:sunny: Try build successful - checks-actions Build commit: 7c1e66778214e445126667614fe1d6a72eb7d2ea (7c1e66778214e445126667614fe1d6a72eb7d2ea)

bors avatar Mar 12 '24 13:03 bors

@rust-timer build 7c1e66778214e445126667614fe1d6a72eb7d2ea

lqd avatar Mar 12 '24 13:03 lqd

Queued 7c1e66778214e445126667614fe1d6a72eb7d2ea with parent 5b7343b96681c93f6fe752b46d9427f9dee8f94b, future comparison URL. There is currently 1 preceding artifact in the queue. It will probably take at least ~2.1 hours until the benchmark run finishes.

rust-timer avatar Mar 12 '24 13:03 rust-timer

Finished benchmarking commit (7c1e66778214e445126667614fe1d6a72eb7d2ea): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never @rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.5% [0.3%, 0.6%] 3
Improvements ✅
(primary)
-2.7% [-7.7%, -0.5%] 214
Improvements ✅
(secondary)
-2.8% [-6.4%, -0.6%] 214
All ❌✅ (primary) -2.7% [-7.7%, -0.5%] 214

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.5% [1.0%, 21.4%] 62
Regressions ❌
(secondary)
9.1% [1.7%, 35.5%] 68
Improvements ✅
(primary)
-3.5% [-5.7%, -1.6%] 9
Improvements ✅
(secondary)
-3.5% [-4.6%, -3.2%] 4
All ❌✅ (primary) 2.6% [-5.7%, 21.4%] 71

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-4.9%, -0.9%] 73
Improvements ✅
(secondary)
-3.5% [-9.6%, -2.0%] 96
All ❌✅ (primary) -2.3% [-4.9%, -0.9%] 73

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 672.558s -> 667.981s (-0.68%) Artifact size: 309.99 MiB -> 298.62 MiB (-3.67%)

rust-timer avatar Mar 12 '24 23:03 rust-timer