Message70540
+0
* The peepholer comment promises "Optimizations are restricted to simple
transformations occuring within a single basic block." and this goes
beyond that. You could patch that comment.
* This needs a matching patch to Lib/test/test_peepholer.py
* Deeply nested "if"s suffer a flat penalty because the unconditional
jump peepholer figures this out after the first extra POP_TOP (notice
the JUMP_ABSOLUTE in your second disassembly).
* I noticed the NOP assignment is commented out in your patch, was that
unsafe?
I searched for old threads on the peephole optimizer and came up with these:
Skip Montanaro's paper
http://www.webfast.com/~skip/python/spam7/optimizer.html
Two old python-dev threads
http://www.gossamer-threads.com/lists/python/dev/645669
http://www.gossamer-threads.com/lists/python/dev/645669
I was hoping to find out if writing a bytecode optimizer in python had
been discussed because a generic version of your optimization would be
really easy to write in pure python (using a dict for the jump table,
for instance). I found nothing; my search terms might have been
insufficient. |
|
Date |
User |
Action |
Args |
2008-08-01 03:43:16 | jackdied | set | recipients:
+ jackdied, _doublep |
2008-08-01 03:43:16 | jackdied | set | messageid: <1217562196.11.0.281268296469.issue2260@psf.upfronthosting.co.za> |
2008-08-01 03:43:15 | jackdied | link | issue2260 messages |
2008-08-01 03:43:13 | jackdied | create | |
|