Mailing List Archive

1.6 speed
Python 1.6a2 is around 10% slower than 1.5 on pystone.
Any idea why?

[amk@mira Python-1.6a2]$ ./python Lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 3.59
This machine benchmarks at 2785.52 pystones/second

[amk@mira Python-1.6a2]$ python1.5 Lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 3.19
This machine benchmarks at 3134.8 pystones/second

--amk
RE: 1.6 speed [ In reply to ]
> Python has been at a critical size with its main loop.
> The recently added extra code exceeds this size.
> I had the same effect with Stackless Python, and
> I worked around it already.

OK - so let us in on your secret! :-)

Were your work-arounds specific to the stackless work, or could they be applied here?

Only-2-more-years-of-beating-up-Guido-before-stackless-time-ly,

Mark.
Re: 1.6 speed [ In reply to ]
"A.M. Kuchling" wrote:
>
> Python 1.6a2 is around 10% slower than 1.5 on pystone.
> Any idea why?
>
> [amk@mira Python-1.6a2]$ ./python Lib/test/pystone.py
> Pystone(1.1) time for 10000 passes = 3.59
> This machine benchmarks at 2785.52 pystones/second
>
> [amk@mira Python-1.6a2]$ python1.5 Lib/test/pystone.py
> Pystone(1.1) time for 10000 passes = 3.19
> This machine benchmarks at 3134.8 pystones/second

Hee hee :-)

D:\python>python Lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.92135
This machine benchmarks at 5204.66 pystones/second

D:\python>cd \python16

D:\Python16>python Lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 2.06234
This machine benchmarks at 4848.86 pystones/second

D:\Python16>cd \python\spc

D:\python\spc>python Lib/test/pystone.py
python: can't open file 'Lib/test/pystone.py'

D:\python\spc>python ../Lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.81034
This machine benchmarks at 5523.82 pystones/second

More hee hee :-)

Python has been at a critical size with its main loop.
The recently added extra code exceeds this size.
I had the same effect with Stackless Python, and
I worked around it already.

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
Re: 1.6 speed [ In reply to ]
Mark Hammond wrote:
>
> > Python has been at a critical size with its main loop.
> > The recently added extra code exceeds this size.
> > I had the same effect with Stackless Python, and
> > I worked around it already.
>
> OK - so let us in on your secret! :-)
>
> Were your work-arounds specific to the stackless work, or could they be applied here?

My work-arounds originated from code from last January where
I was on a speed trip, but with the (usual) low interest
from Guido. Then, with Stackless I saw a minor speed loss
and finally came to the conclusion that I would be good to
apply my patches to my Python version.
That was nothing special so far, and Stackless was still a
bit slow. I though this came from the different way to
call functions for quite a long time, until I finally found
out this February:
The central loop of the Python interpreter is at a critical
size for caching. Speed depends very much on which code
gets near which other code, and how big the whole interpreter
loop is.
What I did:
- Un-inlined several code pieces again, back into functions
in order to make the big switch smaller.
- simplified error handling, especially I ensured that all
local error variables have very short lifetime and are
optimized away
- simplified the big switch, tuned the why_code handling
into special opcodes, therefore the whole things gets
much simpler.

This reduces code size and therefore the probability
that we are in the cache, and due to short variable
lifetime and a simpler loop structure, the compiler
seems to do a better job of code ordering.

> Only-2-more-years-of-beating-up-Guido-before-stackless-time-ly,

Yup, and until then I will not apply my patches to Python,
this is part of my license: Use it but only *with* Stackless.

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
Re: 1.6 speed [ In reply to ]
"A.M. Kuchling" wrote:
>
> Python 1.6a2 is around 10% slower than 1.5 on pystone.
> Any idea why?

I submitted a comparison with Stackless Python.
Now I actually applied the Stackless Python patches
to the current CVS version.

My version does again show up as faster than standard Python,
with the same relative measures, but I too have this effect:

Stackless 1.5.2+ is 10 percent faster than Stackless 1.6a2.

Claim:
This is not related to ceval.c .
Something else must have introduced a significant speed loss.

Stackless Python, upon the pre-unicode tag version of CVS:

D:\python\spc>python ../lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.80724
This machine benchmarks at 5533.29 pystones/second

Stackless Python, upon the recent version of CVS:

D:\python\spc\Python-cvs\PCbuild>python ../lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.94941
This machine benchmarks at 5129.75 pystones/second

Less than 10 percent, but bad enough.

I guess we have to use MAL's test suite and measure everything
alone.

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
Re: 1.6 speed [ In reply to ]
Ack, sorry.
Please drop the last message.
This one was done with the correct dictionaries.
:-()

Christian Tismer wrote:
>
> "A.M. Kuchling" wrote:
> >
> > Python 1.6a2 is around 10% slower than 1.5 on pystone.
> > Any idea why?
>
> I submitted a comparison with Stackless Python.
> Now I actually applied the Stackless Python patches
> to the current CVS version.
>
> My version does again show up as faster than standard Python,
> with the same relative measures, but I too have this effect:
>
> Stackless 1.5.2+ is 10 percent faster than Stackless 1.6a2.
>
> Claim:
> This is not related to ceval.c .
> Something else must have introduced a significant speed loss.
>
> Stackless Python, upon the pre-unicode tag version of CVS:
>
> D:\python\spc>python ../lib/test/pystone.py
> Pystone(1.1) time for 10000 passes = 1.80724
> This machine benchmarks at 5533.29 pystones/second
>
> Stackless Python, upon the recent version of CVS:
>
this one corrected:

D:\python\spc\Python-slp\PCbuild>python ../lib/test/pystone.py
Pystone(1.1) time for 10000 passes = 1.98433
This machine benchmarks at 5039.49 pystones/second

> Less than 10 percent, but bad enough.

It is 10 percent, and bad enough.

>
> I guess we have to use MAL's test suite and measure everything
> alone.
>
> 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
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://www.python.org/mailman/listinfo/python-dev

--
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