The way to a faster python [was Python IS slow !]

Christian Tismer tismer at appliedbiometrics.com
Tue May 4 11:29:26 EDT 1999


Markus Kohler wrote:
> 
> Fredrik Lundh wrote:
...
> > http://starship.skyport.net/crew/vlad/archive/threaded_code/
> >
> 
> I know.
> 
> But it's not in the main release yet. Didn't  it improve
> performance ?

When I look into MSVC++'s emitted code, the improvement
would be neglectible. It already produces an indirect
jump. Just the two insns which do a range check on the
opcode could perhaps be saved.

> Also when I read USE_INDIRECT_THREADED_CODE it seems to me  it uses
> indirect threading.
> Direct threaded code
> could be still faster on most machines. Of course the implementation
> effort is probably
> bigger.

AFAIK, direct threading would perform worse if not written
in machine language, since everything would be turned
into tiny procedure calls.
Interpreter optimizations seem to be a dead end, when
comparing efforts with results.
I could squeeze 8 per cent out of the interpreter by 
simply moving the argument extraction into the opcode, 
and doing this as a word, not shifting bytes. This 
worked for MSVC, but might be worse on other platforms. 
Mark Lemburg did did some optimizations which are 
orthogonal to that, so this could be combined.

But overall, the speed win isn't so big that it would
be worth to modify the distribution. 
Must be a dramatic win, then perhaps.

cao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list