Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance: voila takes double the time to create widgets compared to Notebook #764

Closed
maartenbreddels opened this issue Nov 16, 2020 · 14 comments

Comments

@maartenbreddels
Copy link
Member

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.

@maartenbreddels
Copy link
Member Author

jupyter/jupyter_client#590 takes off 50% of the time.
~2.8 to ~1.8 seconds

@maartenbreddels
Copy link
Member Author

The 4 seconds mentioned above was with Chrome with the dev console open.

@maartenbreddels
Copy link
Member Author

Minor contributor (few %): ipython/traitlets#638

@maartenbreddels
Copy link
Member Author

tornadoweb/tornado#2955 is another 80msec per 1000 messages.

@maartenbreddels
Copy link
Member Author

adding --Session.key= avoid signing of messages, which also takes off a few %.

@maartenbreddels
Copy link
Member Author

jupyter-widgets/ipywidgets#3020
and
ipython/traitlets#639

scrape of 30%

@maartenbreddels
Copy link
Member Author

A 5x improvement might be possible based on #766 and jupyter-widgets/ipywidgets#3021

@jtpio
Copy link
Member

jtpio commented Sep 2, 2021

@maartenbreddels is this issue still valid with #933 now merged and released in 0.2.11?

@pierrotsmnrd
Copy link

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.

@martinRenou
Copy link
Member

Things should be improved with the coming ipywidgets release and #766

@pierrotsmnrd
Copy link

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)

@vidartf
Copy link
Contributor

vidartf commented Dec 20, 2021

@pierrotsmnrd The release plans of ipywidgets 8 can be tracked here: jupyter-widgets/ipywidgets#2750

@pierrotsmnrd
Copy link

Thanks a lot @vidartf, that's exactly what I was looking for.

@martinRenou
Copy link
Member

This is fixed now with #766 and recent ipywidgets releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants