The problem with these JIT/kernel implementations is that there is an extra step of copying data over to the function. Some implementations like numba work around that by exposing raw pointers to python for numeric arrays, but I don't know of any framework which can do that with python objects.
What we need is a framework which can mirror python code in jit code without effort.
@jit.share
class ComplexClass:
def __init__(self, complex_parameters: SharedParameters):
self.complex_parameters = complex_parameters
self.x = 42
self.y = 42
def function_using_python_specific_libraries_and_stuff(self):
...
@jit
def make_it_go_fast(obj: ComplexClass):
...
# modify obj, it is mirrored in jit code,
# but shares its memory with the python object
# so any change also effects the passed python object
# initially, this can be done with observers,
# but then we will need some sort of memory aligned
# direct read/write regions for real speed
The complexity arises when function_using_python_specific_libraries_and_stuff uses exported libraries. The JIT code has to detect their calls as wrappers for shared objects and pass them through for seamless integration and only compile the python specific AST.
What we need is a framework which can mirror python code in jit code without effort.
The complexity arises when function_using_python_specific_libraries_and_stuff uses exported libraries. The JIT code has to detect their calls as wrappers for shared objects and pass them through for seamless integration and only compile the python specific AST.