[Python-ideas] Optimizing builtins

Terry Reedy tjreedy at udel.edu
Sat Jan 1 23:16:16 CET 2011


On 1/1/2011 3:37 PM, Guido van Rossum wrote:

> And, of course, the (relative) simplicity of the implementation will
> always draw CS students looking for compiler optimization projects

And, ironically, slightly reduce the simplicity that attracted them.

No one thinks that their straw will break the camel's back (or cause him 
to drop to his knees), and they are usually right. But when the camel 
sags, all added straws are equally responsible.

> (just as the simplicity of the language draws CS students looking to
> write a complete compiler). But it's one thing to get a degree out of
> some clever optimization; it's another thing to actually make it stick
> in the context of CPython, with the concerns you mention (and others I
> only have in my guts :-).

For one thing, you have your eye on the camel ;-). And your current job 
keep you grounded in the needs of real code.

(In a current python-list discussion, someone demonstrated with timeit 
that in late 2.x, each iteration of 'while 1: pass' takes about a 
microsecond less than for 'while True: pass'. The reason for that, and 
the disappearance of the difference in 3.x is mildly interesting, but 
the practical import for any real code that does anything inside the 
loop is essentially 0.)

-- 
Terry Jan Reedy




More information about the Python-ideas mailing list