Chimera uses the musl libc. This has a variety of implications:
- Application compatibility may not be as big as with glibc
- Most proprietary applications will not work without flatpak or another container solution
- Proprietary drivers with userland parts will not work at all (most notably the NVIDIA graphics driver)
- Minor performance impact is expected
On the other hand, it has some good aspects:
- A cleaner, leaner codebase with lower resource footprint
- Perfect compatibility with our toolchain, including compiler-rt
- Better security and easier hardening
- It helps expose application bugs and fix them, leading to better code across the software stack
The allocator
Chimera by default uses the mimalloc
allocator. This is unlike default musl, which uses its own custom allocator
called mallocng
.
As the stock allocator is the primary reason for nearly all performance
issues people generally have with musl (fewer CPU-optimized algorithms
and so on typically make a negligible impact, while the allocator impact
can be very significant), Chimera has chosen to patch in mimalloc
.
There are, however, scenarios, where one may want to use the stock allocator:
- Those who are particularly security-paranoid and are willing to sacrifice possibly a large chunk of their performance for the peace of mind
- Those for whom memory usage is extremely important, as
mimalloc
is somewhat heavier.
For most people, the default is going to be fine (i.e. if you are not absolutely sure, you should leave things as they are).
In any case, there is a way to install the libc with the stock allocator.
The package is called musl-mallocng
.
If you wish to proceed, create a virtual override first:
# apk add --virtual musl-safety-override
After that, you will be permitted to install the replacement libc:
# apk add musl-mallocng
It is recommended that you do this from a console environment. The machine should be rebooted afterwards.
Reverting to mimalloc
You can pretty much perform the reverse process:
# apk del musl-mallocng musl-safety-override
# apk add musl
The first del
is harmless by itself. It will merely remove musl-mallocng
and musl-safety-override
from world, but will not perform any changes.
The second run will replace musl-mallocng
with regular musl
.
Now you can also remove musl
from world:
# apk del musl
This step is optional.
It is recommended that you have a system with external apk
available for
recovery, or at least a static build of apk
accessible from your current
shell, in case something goes wrong.