voila
voila copied to clipboard
Performance: voila takes double the time to create widgets compared to Notebook
Creating ~600 widgets using:
import ipywidgets as widgets
def recursive(n):
if n == 0:
return widgets.Button(description='Hi')
else:
cls = (widgets.VBox if n % 2 else widgets.HBox)
return cls([recursive(n-1), recursive(n-1)])
recursive(7)
Takes about 1.5-2.0 seconds to display in the notebook, while it takes over 4.0 seconds using Voila.
I think at least one problem lies in the way we update the widgets / sync the state. We ask each widget/comm separately for an update, which causes a 'busy', 'update' and 'idle' message, 3x more than needed. This causes in total 1800 websocket messages. I am also not sure why that seems so slow.
https://github.com/jupyter/jupyter_client/pull/590 takes off 50% of the time. ~2.8 to ~1.8 seconds
The 4 seconds mentioned above was with Chrome with the dev console open.
Minor contributor (few %): https://github.com/ipython/traitlets/pull/638
https://github.com/tornadoweb/tornado/pull/2955 is another 80msec per 1000 messages.
adding --Session.key=
avoid signing of messages, which also takes off a few %.
https://github.com/jupyter-widgets/ipywidgets/pull/3020 and https://github.com/ipython/traitlets/pull/639
scrape of 30%
A 5x improvement might be possible based on https://github.com/voila-dashboards/voila/pull/766 and https://github.com/jupyter-widgets/ipywidgets/pull/3021
@maartenbreddels is this issue still valid with #933 now merged and released in 0.2.11
?
Hi everyone,
I've tested this with Voilà 0.2.16
and I can confirm the issue is still valid. Rendering the snippet above with voilà is taking at least twice more time.
Things should be improved with the coming ipywidgets release and https://github.com/voila-dashboards/voila/pull/766
Hi everyone :)
Any update on this issue and the next ipywidgets release ?
FYI I've tested again with Voilà 0.3.0
and the issue still occurs (logically)
@pierrotsmnrd The release plans of ipywidgets 8 can be tracked here: https://github.com/jupyter-widgets/ipywidgets/issues/2750
Thanks a lot @vidartf, that's exactly what I was looking for.
This is fixed now with #766 and recent ipywidgets releases