[Python-Dev] Re: Prospective Peephole Transformation

Fredrik Lundh fredrik at pythonware.com
Fri Feb 18 09:18:31 CET 2005


Raymond Hettinger wrote:

> Based on some ideas from Skip, I had tried transforming the likes of "x
> in (1,2,3)" into "x in frozenset([1,2,3])".  When applicable, it
> substantially simplified the generated code and converted the O(n)
> lookup into an O(1) step.  There were substantial savings even if the
> set contained only a single entry.

savings in what?  time or bytecode size?  constructed micro-benchmarks,
or examples from real-life code?

do we have any statistics on real-life "n" values?

</F> 





More information about the Python-Dev mailing list