John Machin wrote:
On Mar 13, 2:41 am, spir wrote:
Le Thu, 12 Mar 2009 11:13:33 -0400,
Kent Johnson s'exprima ainsi:
Because local name lookup is faster than global name lookup. Local
variables are stored in an array in the stack frame and accessed by
index. Global names are stored in a dict
On Mar 13, 2:41 am, spir wrote:
> Le Thu, 12 Mar 2009 11:13:33 -0400,
> Kent Johnson s'exprima ainsi:
>
> > Because local name lookup is faster than global name lookup. Local
> > variables are stored in an array in the stack frame and accessed by
> > index. Global names are stored in a dict and a
Poor Yorick wrote:
In the following snippet, the loop in the global namespace takes twice
as long as the loop in the function namespace. Why?
Locals are known to have no outside interaction, and so are not looked
up by name. your code could have a thread that did,
global counter
Poor Yorick wrote:
> In the following snippet, the loop in the global namespace takes twice
> as long as the loop in the function namespace. Why?
>
Accessing global variables is generally slower than accessing local
variables. Locals are effectively stored in a vector so the bytecode can go
s