diojit icon indicating copy to clipboard operation
diojit copied to clipboard

assuming const global references for @jit decorated classes and functions

Open thautwarm opened this issue 5 years ago • 1 comments

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.

thautwarm avatar Nov 03 '20 19:11 thautwarm

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?

thautwarm avatar Nov 03 '20 19:11 thautwarm