Browser rendering extremely slow when many figures in a gridplot
See original GitHub issueHi all,
when I have many figures in a gridplot, browsers take a very very long time to render the html file, even if the data is very small. For instance, when I run
import bokeh.plotting as bplt
import bokeh.io as bio
n_rows = 10
n_columns = 6
data_x = [1, 2, 3]
data_y = [1, 2, 3]
grid = []
for __ in range(n_rows):
row = []
for __ in range(n_columns):
sub_fig = bplt.figure(width=200, height=100)
sub_fig.line(data_x, data_y)
row.append(sub_fig)
grid.append(row)
fig = bplt.gridplot(grid)
bplt.reset_output()
bio.output_file('test.html')
bplt.save(fig)
and then open the ‘test.html’ file in a browser (firefox 53.0.2 or chromium 58.0.3029.96, on ubuntu 16.04 LTS), it takes 40 seconds to render, with 100 % use of one of my CPU (cf below)
Moreover, when the html file is open, the memory used increases by 400 Mo, even if the html file only weights 380 ko.
Do you know if there is a workaround for this problem? Maybe, this slowness is due to one special feature of bokeh, I could bypass? Otherwise, is there a chance that bokeh will soon optimize the rendering of multiple plots? I would love to use bokeh in my project, but I need to make this kind of plots and the rendering time is two long.
Thank you for your work!
EDIT: bokeh==0.12.5
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:25 (14 by maintainers)
Top GitHub Comments
So far we were able to reduce the rendering time of the original example by half (more or less). From here there is much room for improvement across bokehjs, and especially in layout subsystem, which currently dominates initialization time of a multiple plot system with small data size.
Just ran into the same issue plotting the evolution of a bunch of parameters for an MCMC run. My use case involves line plots with 10-60 subplots, with 1-10 lines per plot, each with 100-1000 data points. I’m seeing load times of close to 60 seconds using Bokeh 0.12.4.
Bokeh made it so easy to generate a really useful and beautiful visualization. I’m not sure what can be done about the performance piece, but wanted to add my voice to the crowd that would find it really useful to improve performance in this regime.