[Python-Dev] Re: shared library
Martin v. Löwis
martin at v.loewis.de
Tue Aug 5 21:56:24 EDT 2003
Francois Pinard <pinard at iro.umontreal.ca> writes:
> But I might be missing the meaning of the original question. If by any
> chance you feel like elaborating a bit, that could be instructive for me.
The question is whether the code containing the Python implementation
should be a shared library, i.e. libpythonxy.dll, which would give a
very small stub python executable. I think this causes more bad than
good because:
1. If there is a single <prefix>/python executable, there is just
about the same amount of sharing. Virtually all applications using
Python use the single executable, and they all share that single
executable, both on disk and in memory. The only significant
exception might be mod_python, which currently needs to link its
own copy of the Python implementation. The various run-time copies
of mod_python (across different Apache processes) still get shared.
2. Having libpythonxy.so causes significant maintenance problems. In
some installations, Python might fail to find libpython after
installation, because <prefix>/lib is not in the search path of the
shared linker, or ldconfig might need to be run before it is found.
3. Having libpythonxy.so increases the start-up time, as an additional
directory is added to the ld.so search path, which needs to be
searched for any shared library loaded by Python, including all C
extension modules which are not builtin.
4. Having libpythonxy.so decreases the run-time efficiency, as now all
code needs to be compiled as PIC.
5. Having libpythonxy.so creates a maintenance cost, as, for any
implementation of that feature, it fails on some system because of
obscure compiler/linker/dynamic linker aspects that haven't been
considered. I expect several years to pass until no new bug reports
about that feature come in.
So it has only disadvantages and no advantages, and is thus disabled
by default. It is only implemented to decrease the maintenance burden
of having to respond to people asking for the feature.
Regards,
Martin
More information about the Python-Dev
mailing list