Re: [Fwd: libpng shared memory patch]



On Tue, 25 Apr 2006, Lubos Lunak wrote:

> > Note that even moving from .data to .rodata is desirable anyway,
> > even if it doesn't result in reduced memory consumption, it does
> > result in reduced relocations which is good.
>
>  The question is if those few relocations are worth the effort.

What I typically do when looking at a library is:

1) run: size .libs/*.o
2) see which object files are having exceptionally higher .data
sizes
3) run: objdump -Ct .libs/suspect.o | grep [.]data
4) check the code to see what the main contenders are
5) if it's obvious to fix them, do
6) otherwise if it's a table of like 100 or more entries, seek
   other ways to fix it, ...


The gucharmap oddity that was recently pointed out for example is
a good example of what is worth fixing.  It's tables containing
various strings holding textual data of each Unicode character,
like annotations, etc.  That can use a simple big-string +
offsets-into scheme, but I'm holding on that as I'm going to
rewrite the Unicode Character Database stuff anyway.


Cheers,

--behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
	-- Dan Bern, "New American Language"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]