diojit
diojit copied to clipboard
assuming const global references for @jit decorated classes and functions
F = ...
@jit
def f(x):
return F(x)
In order to get extreme performance gain, flags can be set to break CPython semantics so that F always referenced to the object we've seen, instead of allowing later mutations.
It is observed that in usual cases, global references wouldn't change at all.
If you want to use a mutable global variable in @jit functions, maybe writing globals()[name] is better?