2 ms·
> Libraries are key The last thing you want is to use a library that segfaults now and then, relies on a bubble sort and occasionally allocates a couple of gig
by huhtenberg 19y ago
> Libraries are key
The last thing you want is to use a library that segfaults now and then, relies on a bubble sort and occasionally allocates a couple of gigs of memory. Unfortunately, a vast majority of libraries are exactly of this kind.
I'll give you two real-life examples.
1. netsnmp - de facto open-source standard library for working with SNMP. This piece of engineering marvel makes close to a one million calloc() calls when handling SNMP requests for certain kind of static data. The kind of query that technically does not require even a signle memory allocation.
2. I used to work with a fanboy of ACE, who decided to replace two pages of trivial C code with 10 pages of ACE goodness. Which is fine with me, whatever gets the job done. However then his code, running on a production system, deadlocked deep in the guts of ACE. He spent a week troubleshooting it and in the end he still requested we'd hire "ACE consultant" to help him out.
The point is that even mature libraries have bizarre problems. With a rare exception of super widely used libraries (such as libc, openssl, etc), the library code needs to be reviewed prior to being included into a production code. Caveat emptor.
Vacuum or not, it really comes down to whether you want to debug someone else's bugs at 4 AM on a live server :-)