Skip to content

Use mimalloc allocator for released binaries #19603

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChayimFriedman2
Copy link
Contributor

Speed them up (hopefully).

We can use jemalloc but it's harder to build on Windows. I didn't benchmark so maybe jemalloc is faster.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 16, 2025
@matklad
Copy link
Member

matklad commented Apr 16, 2025

If mimalloc builds everywhere without problems, consider removing allocator option altogether and using mimalloc, always and unconditionally.

@Veykril
Copy link
Member

Veykril commented Apr 16, 2025

Would be good to check whether it actuall is faster for our workload, also whether it has more memory overhead than the default or not

@ChayimFriedman2
Copy link
Contributor Author

ChayimFriedman2 commented Apr 16, 2025

So: I benchmarked this. On Windows this saves 8 seconds in analysis-stats . (but the benchmark was quite noisy, so the difference might be bigger - there definitely is a difference, though), and saves 40mb (but the memory measurement is very imprecise without jemalloc). On Linux this saves 15 seconds, and I couldn't measure memory usage. I don't have a Mac. So, clearly worth it.

@Veykril Veykril added this pull request to the merge queue Apr 16, 2025
@lnicola
Copy link
Member

lnicola commented Apr 16, 2025

I can't check right now, but IIRC mimalloc used to use a lot more memory :-).

@ChayimFriedman2 ChayimFriedman2 removed this pull request from the merge queue due to a manual request Apr 16, 2025
@ChayimFriedman2
Copy link
Contributor Author

I can't check right now, but IIRC mimalloc used to use a lot more memory :-).

I cancelled the merge. When will you be able to check it? On Windows memory usage even (slightly) improve.

@lnicola
Copy link
Member

lnicola commented Apr 16, 2025

On Linux I get:

104.01user 2.96system 1:47.43elapsed 99%CPU (0avgtext+0avgdata 4643236maxresident)k # glibc
86.52user 2.85system 1:29.44elapsed 99%CPU (0avgtext+0avgdata 5156344maxresident)k # mimalloc
91.89user 3.07system 1:35.34elapsed 99%CPU (0avgtext+0avgdata 4654904maxresident)k # jemalloc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants