I’m not sure if this issue is specific to just Bokeh or if Panel adds to it, but after upgrading to Bokeh 2.4.0, I’ve been seeing massively degraded performance in quadmeshes & heatmaps when serving pre-rendered charts via Panel HTML pane embeddings.
The left side shows the pre-rendered chart as standalone html file, while the right side shows the same pre-rendered chart embedded via Panel HTML pane.
This used to work fine before the update to 2.4.0.
Was also reported here:
opened 06:21AM - 17 Sep 21 UTC
closed 09:50AM - 17 Sep 21 UTC
type: bug
tag: regression
reso: completed
tag: performance
NEEDS BACK PORT
Possible regression from bokeh ver 2.3.0 to 2.4.0.
Python 3.8. Chrome Version… 93.0.4577.82 (Official Build) (64-bit). Ubuntu 20.
The hover tool is lightening fast to render in v2.3.0, but is very slow in 2.4.0 for the same minimal example.
```
from bokeh.layouts import layout
from bokeh.io import show
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Range1d, LinearScale, LinearAxis, HoverTool
NUM_DATA_POINTS = 48000
source = ColumnDataSource(data={
"t": [i for i in range(1, NUM_DATA_POINTS)],
"i": [i for i in range(1, NUM_DATA_POINTS)],
"y": [i * 2 for i in range(1, NUM_DATA_POINTS)],
})
plot = figure(toolbar_location="above",
y_range=(0.1, NUM_DATA_POINTS*4),
x_range=(0, NUM_DATA_POINTS),
y_axis_type="linear")
line = plot.line(x="t", y="i", line_width=2, source=source, color="green", legend_label="i")
plot.line(x="t", y="y", line_width=4, alpha=0.4, source=source, color="red", legend_label="y")
ht = HoverTool(
tooltips=[("i", "@i{0.00}"), ("y", "@y{0}"), ("t", "@t{0.000} ms")],
# >>> Uncomment to make hover tool really slow
#mode='vline',
#show_arrow=True,
#renderers=[line],
)
plot.tools = [ht]
doc_layout = layout()
doc_layout.children.append(plot)
show(doc_layout)
```
Chrome Inspect console:
```
bokeh-2.4.0.min.js:520 [Violation] 'requestAnimationFrame' handler took 6005ms
bokeh-2.4.0.min.js:520 [Violation] 'requestAnimationFrame' handler took 5998ms
bokeh-2.4.0.min.js:520 [Violation] 'requestAnimationFrame' handler took 6091ms
```
Edit:
Seems like the same issue is also present in Jupyterlab.
1 Like
Sounds like this unfortunate regression has already been fixed in bokeh and will be included in Bokeh 2.4.1
1 Like