Currently the ThreadPoolExecutors that are used for the production dynamics and checkpointing are created in the inner-most loop, so they are recreated each repex cycle. Instead, we can create persistent thread pools outside of the main loop and use them via map, shutting down on completion. This avoids any OS-level overheads from initialising and tearing down the pool. In local testing this seems to give a minor performance boost.
Currently the
ThreadPoolExecutors that are used for the production dynamics and checkpointing are created in the inner-most loop, so they are recreated each repex cycle. Instead, we can create persistent thread pools outside of the main loop and use them via map, shutting down on completion. This avoids any OS-level overheads from initialising and tearing down the pool. In local testing this seems to give a minor performance boost.