We use to_thread in the BatchedCodecPipeline for running CPU-heavy work on a separate thread. to_thread is slow, according to python/cpython#136084 and also our observations in the development of the synchronous codec pipeline. Something faster than to_thread (e.g., a plain thread pool!) but also "coroutiney" for CPU-heavy work would be worth investigating.
We use
to_threadin theBatchedCodecPipelinefor running CPU-heavy work on a separate thread.to_threadis slow, according to python/cpython#136084 and also our observations in the development of the synchronous codec pipeline. Something faster thanto_thread(e.g., a plain thread pool!) but also "coroutiney" for CPU-heavy work would be worth investigating.