help-gplusplus
[Top][All Lists]
Advanced

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

Re: ld Linker extremely slow. Possible to optimze link time?


From: Bernd Strieder
Subject: Re: ld Linker extremely slow. Possible to optimze link time?
Date: Thu, 08 Feb 2007 14:02:24 +0100
User-agent: KNode/0.10.1

Hello,

Stephan Kuhagen wrote:

> I have some shared libs which link very slow. From about 350 libs,
> most of them link in nearly no time, but for some ld needs about 30
> Minutes to link and uses about 260 MB of RAM (on Linux, FC6/32bit, on
> a AMD Athlon 64 X2 Dual Core Processor 4400+, 2GB RAM). The slow libs
> make heavy usage of templates, if this is a hint, and link to a bunch
> of external libs (ITK, if someone knows them).

What a coincidence, I think we have at least a similar or the very same
problem, posted about the same time. See the thread "Exorbitant link
times with debug info".

When using templates a lot, a lot of functions are generated multiple
times and the duplicates have to be removed by the linker. There are
optimizations to improve that, some gcc make them possible, others not,
this is what I found out.

I had some success with using self-compiled gcc, e.g. the latest 4.1
prerelease 4.1.2-20070129, but I'm still trying to find out how to be
sure to avoid the problem. We'll see, I hope.

> 
> I tried to set --hash-size=X with X from 112000 to 512000, but memory
> usage of ld is always the same and performance also. Are there any
> other tricks to improve the speed, or do I have to live with that?
> (Makes it very hard to use, since re-compilation is done
> continuously...)

I remember I tried hash-size once, without any real improvement, a few
percent at most. That would be clear, because obviously the time is not
lost in the hash-table in our cases.

I think the problem changed with the distro I used. Without knowing the
actual numbers SuSE 9.0 slow, 9.3 and 10.0 fast, 10.1 slow again.
Sometimes just using a self-compiled gcc or binutils was enough to make
it fast again. Often I used self-compiled gcc, just because of the C++
improvements, distro compilers used to be <=3.3 for a long time.
Perhaps you had less problems with FC<6, do you remember?

Bernd Strieder



reply via email to

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