3 ms·
One approach I've done, to try and reduce the performance hit, is: def uses_foo(x): global uses_foo import foo uses_foo = foo.bar
by dalke 4y ago
One approach I've done, to try and reduce the performance hit, is:
def uses_foo(x):
global uses_foo
import foo
uses_foo = foo.bar
return foo.bar(x)
While that performance suckage improves, the other suckages get worse.