Shared vs static link performance hit --and Windows?

Lothar Scholz llothar at
Wed Jul 9 21:12:23 CEST 2003

Christos "TZOTZIOY" Georgiou <tzot at> wrote in message news:<k7clgvoqjur1f10mosue3os74vv7nd34hi at>...
> Last night I was compiling the latest python snapshot at my home Linux
> system (a K6-III @420 --the extra 20 Hz is overclocking :); then I tried
> building a shared version of the interpreter.  I did some speed
> comparisons, and pystone reported ~6090 pystones for the shared and
> ~7680 pystones for the (default) static build.

Yes, today i recommend to not use the -fPIC option for certain
libraries when compiling a .so library. If you use it you get one more
indirection and this can be very bad on systems with long CPU
pipelines (PIV systems). If you don't use -fPIC then the shared
library will be patched and is only shared on disk but not in memory.

I hope that the UNIX community gives up this 20 year old ELF format
and start to use a new one with better performance - look at KDE to
see the pain.

More information about the Python-list mailing list