[Patches] [Patch #101019] Opcode reordering

noreply@sourceforge.net noreply@sourceforge.net
Mon, 31 Jul 2000 06:43:18 -0700


Patch #101019 has been updated. 

Project: 
Category: core (C code)
Status: Postponed
Summary: Opcode reordering

Follow-Ups:

Date: 2000-Jul-30 01:34
By: marangoz

Comment:
Mainly for peace of mind - as discussed on python-dev,
aims at reducing cache effects.

The Top5 opcodes have been moved to the beginning of
the main loop, ordered by decreasing frequency according
to DXP and MAL's statistics.

LOAD_FAST & LOAD_CONST have been slightly tweaked
so that the code sequence is 'unique' amongst the other opcodes.
Otherwise, the optimizer is likely to generate a jump to another
common block later in the loop which obviates the whole point
of moving these opcodes to the top.

- The condition in LOAD_FAST is inversed
- LOAD_CONST has been changed from 'break' to 'continue'.
   Indeed, if x == NULL, we would have dumped core at the
   Py_INCREF(x) preceding the break...

Some testing on Lunix, Solaris and AIX shows no slowdowns <wink>.
There seems to be some speedup, but in some cases it is barely
noticeable.

I dropped the idea of folding opcodes. The bahavior is unpredictable.
If someone wants to spend her entire life between balancing caching
and pipelining in ceval.c, no problem <wink>. I'm out of this game.

As usual, please test (notably on Windows)
-------------------------------------------------------

Date: 2000-Jul-31 06:43
By: gvanrossum

Comment:
Status set to Postponed, just to indicate that this is still experimental and not slated for inclusion into 2.0.  Thanks for submitting this though -- it's good that it's recorded somewhere.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101019&group_id=5470