3 ms·
Historically this was a legitimate performance micro-optimization in Python: def f(i): ... def g(): _f = f for i in range(100
by nerdponx 4y ago
Historically this was a legitimate performance micro-optimization in Python:
def f(i):
...
def g():
_f = f
for i in range(100000):
_f(i)
because looking up a local variable was faster than looking up a global. I'm not sure if that's still true in newer versions.
- nequo 4y agoSounds like Lua. But I see no difference in execution time with Python 3.10.