This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Shared library annoyance with gcc-3_0-branch
- To: Linus Torvalds <torvalds at transmeta dot com>
- Subject: Re: Shared library annoyance with gcc-3_0-branch
- From: Oleg Krivosheev <kriol at bpmail dot fnal dot gov>
- Date: Thu, 22 Feb 2001 10:05:34 -0600 (CST)
- cc: gcc at gcc dot gnu dot org
On Tue, 20 Feb 2001, Linus Torvalds wrote:
>
> On Tue, 20 Feb 2001, Geert Bosch wrote:
> >
> > BTW, what is the overhead on Linux for calling routines in dynamic
> > libraries as opposed to code statically linked in? Has anybody done
>
> It's noticeable, and it depends on the architecture.
>
> With static linking, you can often do static optimizations that tend to be
> rather nasty to do on any dynamic libraries. Things like knowing when the
> rotines share GOT entries etc. Things like knowing that you could just use
> a short indirect branch instead of having to go through a register.
>
> There's also the issue of just loading, which can be expensive in itself.
> However, most cases where you _really_ care, and are willing to work at
> it, can just link statically, I suspect.
>
> I don't think performance is the first-order worry here. libgcc doesn't
> tend to be _that_ performance-sensitive (if it was, much of it would be
> inlined - but it tends to be used for stuff where the overhead of a
> function call is not all that noticeable).
>
> Linus
>
i have multihour numerical code with small memory
footprint which runs faster (+20%) while linked
shared vs static. Go figure... ;)
OK