Skip to content

[BUG] Hover tool takes long time to render #11629

@sistemicorp

Description

@sistemicorp

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions