[Fwd: [Python-Dev] Where the speed is lost! (was: 1.6 speed)]

Christian Tismer tismer@tismer.com
Wed, 26 Apr 2000 23:24:39 +0200


This is a multi-part message in MIME format.
--------------68440C5CBBDDB83FA1ADCF41
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I forgot to cc python-dev.
This file is closed for me.

the sun is shining again, life is so wonderful
   and now for something completely different - chris
--------------68440C5CBBDDB83FA1ADCF41
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

X-Mozilla-Status2: 00000000
Message-ID: <39075D58.C549938E@tismer.com>
Date: Wed, 26 Apr 2000 23:19:20 +0200
From: Christian Tismer <tismer@tismer.com>
X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I)
X-Accept-Language: en
MIME-Version: 1.0
To: jeremy@cnri.reston.va.us
CC: Guido van Rossum <guido@cnri.reston.va.us>,
 	Neil Schemenauer <nascheme@enme.ucalgary.ca>,
 	Mark Hammond <MHammond@skippinet.com.au>,
 	"M.-A. Lemburg" <mal@lemburg.com>
Subject: Re: [Python-Dev] Where the speed is lost! (was: 1.6 speed)
References: <3905EEB4.4153A845@tismer.com>
		<14598.9873.769055.198345@goon.cnri.reston.va.us>
		<39074295.FA136113@tismer.com>
		<14599.17827.23033.266024@goon.cnri.reston.va.us>
		<3907498B.C596C495@tismer.com> <14599.20985.493264.876095@goon.cnri.reston.va.us>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Friends,

here my end of the long story. Full stop.
Now everything fits together.

Jeremy Hylton wrote:
...

> Unfortunately, this doesn't explain the overall performance change.
> This case only shows up on pybench and our nano-benchmark.  There is
> no instance creation to speak of in pystone.  It may be, however, that
> some other part of Python is raising and clearing expensive
> exceptions.

Wrong!
This solves nearly everything.
Here is Python 1.6's pystone:

bash-2.02# python d:/python/lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 2.08081
This machine benchmarks at 4805.81 pystones/second
bash-2.02# pwd
//d/python16

Here is Python 1.5.2 pre-unicode plus Stackless Patches:

bash-2.02# python d:/python/lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.79462
This machine benchmarks at 5572.2 pystones/second
bash-2.02# pwd
//d/python/spc

And here, Python 1.6 plus Patch plus Stackless:

bash-2.02# python d:/python/lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.83961
This machine benchmarks at 5435.94 pystones/second

Now stay tuned:
I rename tupleobject.c to dupleobject.c
and stringobject.c to dstringobject.c,
save the project, close, open it and rebuild all.

*SUPRISE SURPRISE*

bash-2.02# python d:/python/lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.77519
This machine benchmarks at 5633.19 pystones/second
bash-2.02# pwd
//d/python/spc/Python-slp/PCbuild

Summary:
We had two effects here.
Effect 1: Wasting time with extra errors in instance creation.
Effect 2: Loss of locality due to code size increase.

Solution to 1 is Jeremy's patch.
Solution to 2 could be a little renaming of the one
or the other module, in order to get the default
link order to support locality better.

Now everything is clear to me. My first attempts with
reordering could not reveal the loss with the instance stuff.

All together, Python 1.6 is a bit faster than 1.5.2 if
we try to get related code ordered better.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com

--------------68440C5CBBDDB83FA1ADCF41--