what is a peephole optimizer?
and where can I get one? You might poke around looking for Michael Hudson’s (I think he’s the author) byte code hacks package. The freeze/xfreeze family also uses some peephole optimization techniques. I wrote a demonstration peephole optimizer which I mentioned in a post earlier today. If you’re anxious to dive into it (it’s nearly three years old and was written for Python 1.5.1), I just remembered it’s available from http://musi-cal.mojam.com/~skip/python/ (search for “peephole”). An HTML version of the paper I presented at SPAM-7 is also there. A peephole optimizer is generally a last-ditch effort at reorganizing code (often, the assembly code generated by an earlier pass of the compiler) by only considering patterns that extend over a relatively small string of opcodes. If you think of watching a construction site through a knothole in a fence, you’ll get the idea. You only see a little bit of the whole program at once. In the absence of other optimization techniques you can somet