[Python-ideas] Interrogate alternate namespace keyword and concept

Steven D'Aprano steve at pearwood.info
Sun Aug 16 08:17:52 CEST 2009

On Sun, 16 Aug 2009 11:09:59 am Greg Ewing wrote:
> Steven D'Aprano wrote:
> > if you want to know
> > how long it takes to make fresh stir-fried chicken, you have to
> > include the ten minutes it takes to chop up the vegetables and
> > chicken,
> Don't forget to include the time required to catch and kill
> the chicken as well!

"In order to make an apple pie from scratch, you must first create the 
universe." -- Carl Sagan

Of course all timing tests make certain assumptions, and the art of 
optimization is partly to recognise when those assumptions are 
violated. If you do have a situation where you are executing the exact 
same code repeatedly, then pre-compiling is a good optimization over 
calling exec on the string directly. But you can't exclude the time for 
pre-compiling in the general case.

Steven D'Aprano

More information about the Python-ideas mailing list