libpython as a shared library?

Martin v. Löwis loewis at informatik.hu-berlin.de
Thu Jun 6 04:37:42 EDT 2002


Gregor Hoffleit <gregor at hoffleit.de> writes:

> If I compile the sources with -fPIC, but put them in a static library,
> there's nearly no speed difference to non-PIC code in a static library.
> My best guess is that the speed penalty is caused by the indirection
> step that's necessary when calling routines from a shared lib; but then,
> that's no real explanation for a loss of 30% speed!

Can you elaborate a bit what you measured to get that speed difference?

If it involves startup time, the time for locating libpython surely
involves part of startup time. Also, it might be necessary to perform
many relocations to libpython at run time that might not be necessary
for the application.

Regards,
Martin




More information about the Python-list mailing list