Comparison of C/POSIX standard library implementations for Linux

https://news.ycombinator.com/rss Hits: 5
Summary

Comparison of C/POSIX standard library implementations for Linux A project of Eta Labs. The table below and notes which follow are a comparison of some of the different standard library implementations available for Linux, with a particular focus on the balance between feature-richness and bloat. I have tried to be fair and objective, but as I am the author of musl, that may have influenced my choice of which aspects to compare. Future directions for this comparison include detailed performance benchmarking and inclusion of additional library implementations, especially Google's Bionic and other BSD libc ports. Bloat comparison musluClibcdietlibcglibc Complete .a set 426k 500k 120k 2.0M † Complete .so set 527k 560k 185k 7.9M † Smallest static C program 1.8k 5k 0.2k 662k Static hello (using printf) 13k 70k 6k 662k Dynamic overhead (min. dirty) 20k 40k 40k 48k Static overhead (min. dirty) 8k 12k 8k 28k Static stdio overhead (min. dirty) 8k 24k 16k 36k Configurable featureset no yes minimal minimal Behavior on resource exhaustion musluClibcdietlibcglibc Thread-local storage reports failure aborts n/a aborts SIGEV_THREAD timers no failure n/a n/a lost overruns pthread_cancel no failure aborts n/a aborts regcomp and regexec reports failure crashes reports failure crashes fnmatch no failure unknown no failure reports failure printf family no failure no failure no failure reports failure strtol family no failure no failure no failure no failure Performance comparison musluClibcdietlibcglibc Tiny allocation & free 0.005 0.004 0.013 0.002 Big allocation & free 0.027 0.018 0.023 0.016 Allocation contention, local 0.048 0.134 0.393 0.041 Allocation contention, shared 0.050 0.132 0.394 0.062 Zero-fill (memset) 0.023 0.048 0.055 0.012 String length (strlen) 0.081 0.098 0.161 0.048 Byte search (strchr) 0.142 0.243 0.198 0.028 Substring (strstr) 0.057 1.273 1.030 0.088 Thread creation/joining 0.248 0.126 45.761 0.142 Mutex lock/unlock 0.042 0.055 0.785 0.046 UTF-8 decode buffered ...

First seen: 2025-05-10 16:19

Last seen: 2025-05-10 20:19