Why using asyncio on BatchHandler._postprocess_batch()? #129
aiorga-sherpas
started this conversation in
General
Replies: 1 comment
-
|
Great catch! Short answer: I am currently putting 'asyncio.Futures' in the queue - asyncio.futures are not threadsafe. Asyncio.sleep - I'll verify to which degree they are helpful / if the speedup is still valid across all platforms supported nowadays. The sleep is primarily because the other threads are starting to execute at the same time & not block the model thread (Python GIL) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings Michael,
we noticed the use of the ThreadPoolExecutor to run the preprocessing_batch and the core_buch but to execute the postprocess Asycio is used. Is there any particular reason for this?
There is also the following comment: # TODO: the ugly asyncio.sleep() could add to 3-8ms of latency worst case ...
Moving all asynchronous processes to threadpool futures might solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions