FigureWidget performance problem on Jupyterhub
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.
After https://github.com/plotly/plotly.py/pull/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.
@manzt Is it possible that this is related to anywidget?
not able to reproduce - @alexcjohnson is this still a concern for you?
I've had inconsistent results trying to reproduce this myself - may be something strange going on in my Jupyter env. We can close this and I'll reopen if I find a clear pattern.
thanks @alexcjohnson - much appreciated