Skip to content

FigureWidget performance problem on Jupyterhub #5143

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

Open
alexcjohnson opened this issue Apr 15, 2025 · 2 comments
Open

FigureWidget performance problem on Jupyterhub #5143

alexcjohnson opened this issue Apr 15, 2025 · 2 comments
Assignees
Labels
bug something broken P1 needed for current cycle performance something is slow regression this used to work

Comments

@alexcjohnson
Copy link
Collaborator

When I use FigureWidget in v6.0.0 and v6.0.1 in Jupyterhub, even a very simple figure takes about 10 seconds to appear. This is particularly frustrating because it's the default renderer, so for example I see this if I just enter

px.scatter(x=[1,2,3],y=[4,5,6])

and execute the cell. In v5.24.1 the graph appears in about 1 sec. I'm currently in Africa, using a Jupyterhub instance on AWS in us-west-2, so at first I thought the distance may have contributed but a user in Montreal ( @cardinalgeo ) accessing the same instance reports about the same delay. My workaround, in cases where I don't need FigureWidget capabilities, is to change the default renderer:

import plotly.io as pio
pio.renderers.default = 'notebook_connected'

Local Jupyterlab - run either directly in a terminal or via docker - shows no noticeable delay using FigureWidget.

@alexcjohnson alexcjohnson added the performance something is slow label Apr 15, 2025
@gvwilson gvwilson assigned marthacryan and unassigned gvwilson Apr 15, 2025
@gvwilson gvwilson added bug something broken P1 needed for current cycle regression this used to work labels Apr 15, 2025
@alexcjohnson
Copy link
Collaborator Author

After #5096 the default behavior is fast, because the default display is a Figure again. But FigureWidget seems to behave the same as it does in 6.0.0 and 6.0.1, which today is: first display of a FigureWidget takes 10-12 sec, subsequent displays take 3-5 seconds. I don't recall seeing this distinction between first and later displays when I first tested this, but both cases are still much slower than a plain Figure.

@marthacryan
Copy link
Collaborator

@manzt Is it possible that this is related to anywidget?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P1 needed for current cycle performance something is slow regression this used to work
Projects
None yet
Development

No branches or pull requests

3 participants