Comparison of C/POSIX standard library implementations for Linux

etalabs.net

140 points by smartmic 4 days ago


pizlonator - 3 days ago

My own perf comparison: when I switched from Fil-C running on my system’s libc (recent glibc) for yololand to my own build of musl, I got a 1-2% perf regression. My best guess is that it’s because glibc’s memcpy/memmove/memset are better. Couldn’t have been the allocator since Fil-C’s runtime has its own allocator.

ObscureScience - 3 days ago

That table is unfortunately quite old. I can't personally say what have changed, but it is hard to put much confidence in the relevance of the information.

jay-barronville - 3 days ago

Please note that the linked comparison table has been unmaintained for a while. This is even explicitly stated on the legacy musl libc website[0][0] (i.e., “The (mostly unmaintained) libc comparison is still available on etalabs.net.”).

[0]: https://www.musl-libc.org

weiwenhao - 3 days ago

The static compilation of musl libc is a huge help for alpine linux and many system programming languages. My programming language https://github.com/nature-lang/nature is also built on musl libc.

thrtythreeforty - 3 days ago

It really ought to lead with the license of each library. I was considering dietlibc until I got to the bottom - GPLv2. I am a GPL apologist and even I can appreciate that this is a nonstarter; even GNU's libc is only LGPL!

josephg - 3 days ago

It’s amazing how much code gets pulled in for printf. Using musl, printf apparently adds 13kb of code to your binary. Given format strings are almost always static, it’s so weird to me that they still get parsed at runtime in all cases. Modern compilers even parse printf format strings anyway to check your types match.

This sort of thing makes me really appreciate zig’s comptime. Even rust uses a macro for println!().

moomin - 3 days ago

No cosmopolitan, pity.

- 3 days ago
[deleted]
snickerer - 3 days ago

Fun libc comparison by the author of musl.

My getaway is: glibc is bloated but fast. Quite unexpected combination. Am I right?

casey2 - 3 days ago

Where is the "# of regressions caused" box?

edam - 3 days ago

Pretty obviously made by the musl authors.