|
|
|
|
|
by adrian17
3280 days ago
|
|
> Well, I'm not an expert in this, but at a high level, each variable is assigned a location in memory or registers, and then future references to that variable are rewritten to refer to the memory location by register name or memory address. This takes the whole "looking up a name" issue out of the path of work that has to get done at runtime. Python does this for local variable names in functions. Because of this, moving a tight loop from global scope to a function can make it a couple percent faster. |
|