Why is Python so slow ?- revisited.

Bijan Parsia bparsia at email.unc.edu
Thu Jun 22 17:20:10 EDT 2000


Michael Hudson <mwh21 at cam.ac.uk> wrote:

> bparsia at email.unc.edu (Bijan Parsia) writes:
> 
> > Michael Hudson <mwh21 at cam.ac.uk> wrote:
> [snip]
> > > Does Python 1.2 have the local variable optimisation? 
> > 
> > What do you mean?
> > 
> > [snip]
> 
> Certainly at some point there was no LOAD_FAST opcode; every name
> lookup would first look into a local dict, then the global one, then
> the builtins.  Now references to locals are just indexes into (C)
> vectors; this is much quicker.

Ah! Thanks! Am I correct in surmising from this that the gap between a
local access success and a miss (but hitting somewhere up the chain) is
even greater (than before LOAD_FAST)? Hmm.

I think I shall refrain from further speculation about method caches ;)

-- 
Bijan Parsia
http://monkeyfist.com/
...among many things.



More information about the Python-list mailing list