libtool
[Top][All Lists]
Advanced

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

Link performance: some numbers and a hack


From: Iñaki García Etxebarria
Subject: Link performance: some numbers and a hack
Date: Fri, 19 Sep 2003 16:22:11 +0200

Hi,

Is there any need for dependency_libs (in .la files, that is) in linux,
or other platforms where you can put dependency info into the lib
itself?

I ask because I have been trying to improve the abysmal link time for
some gnome apps[1], and come to a simple "worksforme fix" (aka horrible
kludge ;-)), which consists on simple removing all dependency_libs from
the relevant .la files. Yes, you can hate me now :-)

I'm by no means a libtool or ld expert, but everything seems to work
well, and the resulting improvement is huge:

Linking the nautilus executable without the "fix"
-------------------------------------------------
real    3m46.171s
user    3m39.790s
sys     0m2.200s

Linking with it
---------------
real    0m12.858s
user    0m10.640s
sys     0m1.890s

You can further reduce the link time to around 3 seconds if you perform
dependency analysis on the command line and pass to libtool only the
minimum set of libraries. That is, suppose libfoo depends on libbar and
the command line says: '-lfoo -lbar'. You shave off some seconds if you
just pass -lfoo to libtool[2].

I'm aware that this is naïve and will fail in many architectures, but
would it be possible to special case architectures where it works?
Assuming any exist, of course :-)

Thanks for your attention,
Iñaki

[1] Which use tons of libraries, most of them with corresponding .la
files with more deps inside.
[2] For those wondering, I don't do this all by hand, all analysis and
.la dependency removing is done at link time by some wrapper python
scripts available upon request.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]