Musl libc is a more preferable option if security and speed are important to you, compared to glibc, but is this currently the case? Do most applications still not work on musl? And how effective is gcompat?
Musl libc is a more preferable option if security and speed are important to you, compared to glibc, but is this currently the case? Do most applications still not work on musl? And how effective is gcompat?
Saying musl is preferable if speed is important is a bit…loaded. It’s not always untrue, but it often is.
As a libc, musl has a much smaller footprint than glibc, so a computer which is short on memory capacity, memory bandwidth, or cache size could absolutely see a performance benefit. The flipside to this is that a lot of the ‘bloat’ in glibc are performance tricks including lots of architecture specific code.
As others have mentioned, the malloc implementation is less than ideal and can slow down highly threaded & memory intensive applications.
I work on a musl-based embedded distribution for my day-job, and also quite like using it personally for arm boards and my old ThinkPad. I wouldn’t really use it for my workstation though.
As far as applications working with musl, it’s not uncommon to see glibc-specific code which would need to be patched out of some applications (systemd comes to mind).
Do you guys use the stock allocator?
Using mimalloc instead seems to work pretty well.
It does, I quite like mimalloc though I prefer to have programs compiled with their custom allocator rather than inserting them via LD_PRELOAD as I’ve found some issues when using it with programs like Firefox.
Personally, i prefer a smaller general codebase with equal speed vs. a bigger one with specific hacks and workarounds.
But honestly, at this level maybe for critical things like a high-security server (Alpine).
The line between what is a hack and what is basic performance optimisation is both subject to taste and use-case. Horses for courses, right?
Sure.