In article <c18b2cb6-1106-4dfc-86d1->
Ebenezer <> writes:
>On Apr 27, 2:56*pm, jacob navia <ja...@spamsink.net> wrote:
>> Le 27/04/11 21:01, Pete Becker a crit :
>>
>> > On 2011-04-27 14:24:21 -0400, Ebenezer said:
>>
>> >> On Apr 25, 4:53 pm, James Kanze <james.ka...@gmail.com> wrote:
>>
>> >>> The granularity of most linkers is the object file. *In general,
>> >>> if you are writing a library, you put each non-virtual function
>> >>> in a separate object file, and only those which are actually
>> >>> called are included. *(But this is, of course, a quality of
>> >>> implementation issue for the library provider.)
>>
>> >> This seems like a "premature optimization." I haven't come
>> >> across this much, but recall your mentioning it previously.
>>
>> > Not in a general-purpose library. If you get it wrong your customers
>> > complain about code bloat. As an extreme example, linking the entire C
>> > standard library into every application would not be a good thing.
>>
>> For some people all optimizations are "premature" and they deliver
>> bloated, unoptimized programs. Code bloat slows down programs because
>> it forces more main memory reads, and makes code cacheing less
>> efficient. It is a very important optimization.
>
>
>I think this library -- http://quicklz.com -- is a
>quality library, but there's no breaking things up
>like that. I can't think of a library that splits
>things up into such small chunks.
Taking a quick look at libc on my FreeBSD system, I see that it is
split into 849 files. I find this pretty common for general use
libraries.
Less general libraries -- database APIs, toolsets, etc. -- probably
don't take that effort as often.
--
Drew Lawson | And to those who lack the courage
| And say it's dangerous to try
| Well they just don't know
| That love eternal will not be denied