Using uvloop as the event loop

Have anybody tried changing the default python event loop to uvloop? And if you have did you see any noticeable speed improvement or had any problems with it?

If anybody wants to try using uvloop just import it and run uvloop.install() at the top of the code like this:

import panel as pn
import uvloop

uvloop.install()

a = pn.widgets.StaticText(value="Waiting for callback...")

async def see_loop():
    a.value = str(type(pn.state._ioloop.selector_loop)).split("'")[1]


pn.state.add_periodic_callback(see_loop, 1000, count=1)
a.servable()
2 Likes

Oooh, this is really interesting. Iā€™d love to look into it this more. We need to set up some realistic benchmarks to let us compare performance.