4 ms·
The problem with musl is its malloc implementation. It is subpar when compared to glibc malloc. And we know that glibc malloc is generally subpar when compared
by menaerus 2y ago
The problem with musl is its malloc implementation. It is subpar when compared to glibc malloc. And we know that glibc malloc is generally subpar when compared to jemalloc. For large-scale applications with many (concurrent) (small) allocations this will be a big performance problem.
I guess (?) it would be possible to fix this by replacing the musl inline malloc implementation by statically linking against the jemalloc.
- intelVISA 2y agoThat's a good point, haven't looked too deep as I avoid allocations but musl+jemalloc is workable in Rust at least.
- JonChesterfield 2y agoChanging malloc for a different one you like more would work fine in musl. In particular because it has a sane bootstrap structure which means the dynamic loader can call normal C functions, it'll be swap out the code and carry on as normal. I'd suggest replacing it in libc itself instead of requiring a separate library though.