This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
dynamic library cost (was RE: libtool, java woes)
- To: "'Alexandre Oliva'" <aoliva at redhat dot com>, tromey at redhat dot com
- Subject: dynamic library cost (was RE: libtool, java woes)
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Tue, 10 Apr 2001 09:15:40 -0700
- Cc: Jeff Sturm <jsturm at one-point dot com>, java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
> From: Alexandre Oliva [mailto:aoliva@redhat.com]
>
> We either need libsupc++ to be a shared library, that both libstdc++
> and libgcj depend on, or have libgcj depend on libstdc++.
>
One thing to keep in mind with all of this:
I'm seeing significant overheads as a result of dynamic library calls. On a
PII/300 machine, a (single-threaded) loop containing only free(malloc(8))
runs more than 20% faster when it's linked statically. This is similar on
an Itanium machine. I'm not sure how significant that is for typical C
programs, nor how frequently something like libsupc++ is called. I believe
it is currently very significant for libgcj and calls to the garbage
collector library from libgcj.
I doubt there are any easy solutions, but we should be careful not to make
this worse. (Partial solutions might include sometimes expanding the
dynamic library call code inline on Itanium, having gcj generate allocation
code that often directly calls the GC innstead of passing through libgcj,
perhaps somewhow replicating a few frequently called functions like the top
level of the malloc implementation, perhaps dynamically replacing the code
at a few frequently used call sites?)
Hans