Closed michaelgrigoryan25 closed 2 years ago
What's the motivation from removing this from non-msvc environments?
It may probably impact the performance for the worse. For Linux, I think the default system allocator is good enough. Even if it isn't, there are always allocators like jemalloc. Plus, jemalloc is optimized for (multithreaded) speed, not memory usage.
Although this was a while ago, I do remember the allocator switch improved the performance across the board including the docker containers especially (this is possibly slightly different now as some of the docker images have changed)
And yes there is Jemalloc although something in lnx (either a dependency or some implementation) causes a segfault at runtime which we obviously dont want to run into 😅 What's interesting is this only happens with Jemalloc.
I see. I'll close this PR then.
I think i'd probably want to do some performance checks regarding this change before merging it. If it doesn't have any effect or improve it on the debian images then, I'm reasonably happy to merge this. If it negatively impacts it I'm probably going to stick with it, so at least that way it's consistent performance across operating systems.
Okay, sorry for the long delay!
I've run through some benchmarks comparing it against MiMalloc, and overall MiMalloc is considerably faster ~10-20% performance loss when switching back to the default allocator as a best case.
Because of this, I'm going to reject this change as I don't think it's worth it. (MiMalloc is a pretty insignificant dependency to include but has a big affect)
This PR adds a compiler attribute into lnx-server/main.rs to only use
mimalloc
in MSVC environments.