svn commit: r204615 - head/sbin/newfs

Luigi Rizzo rizzo at iet.unipi.it
Wed Mar 3 09:11:56 UTC 2010


On Wed, Mar 03, 2010 at 12:44:06AM -0800, Garrett Cooper wrote:
...
> Maxim,
> 
> Xin Li has a point. I ran some tests and the ad hoc parsing function
> eats up more memory than expand_number(3) [*]:

as someone reminded me, a static library only brings in the archive
members you actually use, whereas with a dinamic library you are forced,
at runtime, to bring in the entire library (which requires duplicating
the static data at least).
So i suspect that even if other programs on the same system already
use libutil, just the library overhead is more than the cost
of a single function.

If one is really concerned with memory usage and at the same time
wants (for the good reasons mentioned in the thread) to reuse
the expand_number code, the it seems that the best approach is
force static link with libutil (to bring in just the function you
need) and use the default approach for the rest.

cheers
luigi



More information about the freebsd-hackers mailing list