Under the hood async_stream_zip uses threads as a layer over the synchronous stream_zip function. Would you accept a more flexible 'pure-asyncio' implementation? This would still allow running async_stream_zip via threads, however in my limited testing simply using asyncio.run provides a 2-5% performance benefit over the current async_stream_zip implementation.
I have thrown together a quick and dirty implementation which is intentionally kept as close to the original as possible. I'm happy to contribute it as a PR for further review and refinement.
Under the hood
async_stream_zipusesthreadsas a layer over the synchronousstream_zipfunction. Would you accept a more flexible 'pure-asyncio' implementation? This would still allow runningasync_stream_zipvia threads, however in my limited testing simply usingasyncio.runprovides a 2-5% performance benefit over the currentasync_stream_zipimplementation.I have thrown together a quick and dirty implementation which is intentionally kept as close to the original as possible. I'm happy to contribute it as a PR for further review and refinement.