why does dead code costs time?

Bruno Dupuis python.ml.bruno.dupuis at lisael.org
Wed Dec 5 18:19:29 CET 2012

On Wed, Dec 05, 2012 at 05:40:51PM +0100, Bruno Dupuis wrote:
> On Wed, Dec 05, 2012 at 04:15:59PM +0000, Neil Cerutti wrote:
> > Maybe it's the difference between LOAD_CONST and LOAD_GLOBAL. We
> > can wonder why g uses the latter.
> Good point! I didn't even noticed that. It's weird... Maybe the
> difference comes from a peehole optim on f which is not possible on g as
> g is to complex.

Neil, you were right, thanks. I patched peehole.c to remove this optim, and
now the figures are the same. I investigate to find out why the latter
function is not optimized the same way (and if it can be, I'll propose a
patch for that)

Bruno Dupuis

More information about the Python-list mailing list