Magic Optimisation

Terry Reedy tjreedy at udel.edu
Wed Sep 14 18:52:19 EDT 2005


"Paul McGuire" <ptmcg at austin.rr.com> wrote in message 
news:1126708466.322632.78990 at g43g2000cwa.googlegroups.com...
> Terry -
>
> If setting up a try-block is as fast (or "takes as long") as one
> iteration loop, then wont putting a try-block inside a loop double the
> execution time?

It will double (more or less) the loop overhead.  The effect of that 
depends on the overhead/payload ratio.  And, I was responding to the idea 
that adding a loop to avoid most try statements would be significantly 
faster.

Terry J. Reedy






More information about the Python-list mailing list