Using libc.a versus libc.so with FreeBSD

Using libc.a versus libc.so with FreeBSD

Post by Tom Huki » Sat, 06 Dec 1997 04:00:00



The Perl FAQ states "If you're currently linking your perl
executable to a shared libc.so, you can often gain a 10-25%
performance benefit by rebuilding it to link with a static libc.a
instead."

I notice that the FreeBSD port of Perl5.00404 uses libc.so, as
does my Web service provider. I assume there is some reason why
this has been done, but I don't know what the differences between
libc.a and libc.so are.

Why might libc.a result in a performance gain, and does this
apply to FreeBSD?

Under which circumstances is it best to use each library?

Thanks (in advance) for your time,
Tom

To reply to this message remove the phrase 'NOSPAM' from my address

--
       Learn how to create amazing web sites

     Visit eBORcOM's Web Development Resources
          http://www.eborcom.com/webmaker/

 
 
 

Using libc.a versus libc.so with FreeBSD

Post by Nick Hilliar » Sat, 06 Dec 1997 04:00:00


Quote:> I notice that the FreeBSD port of Perl5.00404 uses libc.so, as
> does my Web service provider. I assume there is some reason why
> this has been done, but I don't know what the differences between
> libc.a and libc.so are.

> Why might libc.a result in a performance gain, and does this
> apply to FreeBSD?

If you use shared libraries, the startup time is somewhat greater, and the
overall memory use can be larger.  You can use ktrace to find out why.

If you use static libraries, the startup-time is faster, the memory usage is
less, but the binary will be bigger and if you upgrade your libc, you'll have to
recompile perl (actually just relinking will do).

If you're really performance conscious, you'd might want to think about using a
statically linked binary.  But if you were that performance conscious, you
probably wouldn't be using perl, either.

Overall advice: don't bother messing around with a statically linked version -
it's not really worth it.

Nick

 
 
 

1. libc.a and libc.so, libc.so.1libc.so.2, where is my library?

Hi,
  I'm trying to compile on a solaris system after doing a fresh os
install with developer bundles and c/c++ WS Pro compilers. /usr/lib
contains libc.so but no libc.a, <whereis libc.a> points to libc.so, but
my makefiles fail because they can't find the correct .a library files.
Where am I going wrong? What's the difference between the two? And, why
doesn't /usr/lib contain all my .a libraries? Any help would be
appreciated. I'm new to solaris development and am having a really hard
time setting up my environment to compile.

Very frustrated,

Steve

2. aix 4.3.2 modem dialout for non-root user

3. libc 2.x, libc 5, libc 6

4. Lex Macros

5. Why did some of the networking API change between libc.so.5 and libc.so.6?

6. Oh dear, I've stopped thinking.

7. libc.so.4 vs libc.so.5 ?

8. rmon administration

9. How do I relink libc.so.4 to libc.so.4.4.1?

10. libc.so & libc.so.1

11. Statically compiled libc 2.2 using gethostbyname doesn't work on libc 2.0

12. need libc.so.4 on FreeBSD 3.4