You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
Visdom appeals to me because of the iterative send updates to a server. However, I'm always frustrated to see that visdom get and post requests are 10 times (!) slower than my analysis payload script. This is because visdom uses requests under the hood, which is sequential by design.
Describe the solution you'd like
Switching to asyncio coroutines. In particular, using asyncio.create_task. The await mechanism needs to be discussed (when to await? - Either return coroutines to the users to let them handle awaits or make a public function await in the visdom client.) One could also add async flag in Visdom.__init__ which can be False by default.
Describe alternatives you've considered uvloop is a fast, drop-in replacement of the built-in asyncio event loop. uvloop is implemented in Cython and uses libuv under the hood.
Additional context
Take a look at visdom.scatter profile botelnecks:
I'm definitely a fan of asyncio, and would be interested to see Visdom updated to be compatible with coroutines. I worry a bit that we'll lose more backwards compatibility for those who don't have it though, but ultimately think it's the right overall direction.
I'll wait for the #675 first, maybe fix other code style issues, and then consider adding asyncio because adding such an advanced API as asyncio makes sense when the code is relatively clean.
Maybe others are interested in doing this.
Problem
Visdom appeals to me because of the iterative send updates to a server. However, I'm always frustrated to see that visdom get and post requests are 10 times (!) slower than my analysis payload script. This is because visdom uses
requests
under the hood, which is sequential by design.Describe the solution you'd like
Switching to asyncio coroutines. In particular, using
asyncio.create_task
. Theawait
mechanism needs to be discussed (when to await? - Either return coroutines to the users to let them handle awaits or make a public functionawait
in the visdom client.) One could also addasync
flag inVisdom.__init__
which can be False by default.Describe alternatives you've considered
uvloop is a fast, drop-in replacement of the built-in asyncio event loop. uvloop is implemented in Cython and uses libuv under the hood.
Additional context
Take a look at
visdom.scatter
profile botelnecks:Let me know if you're interested in switching to asyncio.
Best,
Danylo
The text was updated successfully, but these errors were encountered: