-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(perf): switch global allocator to mimalloc #14691
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reminds me that since Cargo is no longer a workspace member in rust-lang/rust, we may have missed some optimization they've done in the past. We may also want to check what we should pick up again in Cargo's [profile]
.
Comparison on Linux between
Output of
Output of
The main gain seems to be the memory access to the interned |
If there is little performance gain to specialize allocators for a given platform, I would lean towards keeping things simple and using a single allocator across all of them. |
Here is the comparison of maximum RSS between allocators, when running
|
What version of glibc was used for the system tests? Also, could this be set as a feature so third parties like distros can more easily opt out? I think for integration, I'd rather keep using the system allocator. |
If we're going to do it, we will, just like openssl and libgit2. |
I have |
adab712
to
e40f1c5
Compare
e40f1c5
to
0ce2c6e
Compare
What does this PR try to resolve?
Follow-up of Eh2406/pubgrub-crates-benchmark#6 (comment).
This PR uses
mimalloc
as the global allocator forcargo
. This improves performance of the resolver by reducing allocation and deallocation cost. The performance gains are the same as withjemalloc
, butmimalloc
is compatible with Windows.Comparison of performance using
solana-core = "=1.0.5"
inCargo.toml
:r? Eh2406