inline function call

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Jan 4 13:33:05 EST 2006


Peter Hansen>but I'd be happy to see a real-world case where Psyco gave
a much bigger boost.)<

Psyco can be very fast, but:
- the program has to be the right one;
- you have to use "low level" programming, programming more like in C,
avoiding most of the nice things Python has, like list generators,
etc.;
- you can try to use array.array (for floats and ints), I have found
that sometimes Psyco can use them in a very fast way.

This is an example of mine, it's not really a real-world case, it looks
like C, but it shows the difference, if you switch off Psyco you can
see that it goes much slower:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=fannkuch&lang=psyco&id=0

This Python version is MUCH slower, but it looks more like Python:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=fannkuch&lang=python&id=0
If you try Psyco with this version you can see that it's much slower
than the other one.

This is the summary page, the Python version is about 54 times slower
than the Psyco version:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=fannkuch&lang=all

More info:
http://psyco.sourceforge.net/psycoguide/node29.html

Bye,
bearophile




More information about the Python-list mailing list