Comparing perfs of two python interpreters on the same Linux machine (for Zope)

Benjamin Niemann b.niemann at betternet.de
Tue Sep 14 05:52:42 EDT 2004


Vbfoo Bar wrote:

> Hello,
> 
> To implement a Zope intranet on a linux RedHat ES 3, I had to
> install a Python 2.3.4 that I have compiled myself.
> 
> I would like to compare the respective performance of this
> python interpreter and that of the Python provided by RedHat
> (just a little bench program would be sufficient) as I suspect
> the binary Python 2.3.4 (or just the Zope?) I have produced is 
> very inefficient (very very slow!).
> 
> Additional info below. Thanks by advance for your advice.
> 
> The python binaries on my machine:
> ==================================
> The python that comes with RedHat ES 3 (this is a Python 2.2.3):
> -rwxr-xr-x  2 root  root    795584 Aug  8  2003 /usr/bin/python
> 
> The python I have compiled myself (Python 2.3.4, required and used
> by Zope/plone):
> -rwxr-xr-x  1 root  root   2265733 Jun 25 14:58
> /usr/local/bin/python2.3
> 
> (Note that the binary sizes are very different: is this suspect?)
> 
> How I produced my (apparently inefficient binaries):
> ====================================================
> For python:
> [root# wget http://www.python.org/ftp/python/2.3.4/Python-2.3.4.tgz
> [root# ./configure
> [root# make ; make install
> 
> For zope:
> $ ./configure --prefix=/usr/local/zope-2.7.1-0
> --with-python=/usr/local/bin/python2.3
> $ make
> $ make install

The size difference is probably caused by debug informations (look the -g option 
in the calls to cc and ln while compiling python). This should not cause any 
difference in runtime performance.
The RedHat package probably uses non-default compiler options to tune 
performance. You could fetch the source rpm for RedHats Python, build it (what 
ever tool you need to build binaries from srpm.. I use Debian ;) and look for 
options used by RedHat. Apply them when you configure your python
CGLAGS="-O2 -march=i686 -omit-framepointer" ./configure
(just an example from the very far back of my head, have not done C stuff for 
quite a long time and the options probably look very different..)



More information about the Python-list mailing list