I found many issues while trying to implement this that way, leading to this bug report:
I ended up with a simpler approach and now I have a working prototype that uses caching, profiling and multiprocessing:
I found many issues while trying to implement this that way, leading to this bug report:
I ended up with a simpler approach and now I have a working prototype that uses caching, profiling and multiprocessing: