question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Browser rendering extremely slow when many figures in a gridplot

See original GitHub issue

Hi 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) cpu_bokeh

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:25 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
mattpapcommented, Nov 14, 2017

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.

1reaction
synapticarborscommented, Nov 8, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layout guidelines/tips for rapidly rendering many plots
I observe experimentally that when making interactive changes to a given class' models, the rendering is halting and slow to respond, ...
Read more >
AG-Grid large dataset render time (slow) - Stack Overflow
If the grid was to render 10,000 rows, it would probably crash the browser as too many DOM elements are getting created.
Read more >
Loading/rendering time in browser - Panel - HoloViz Discourse
I am using panel/holoviews/hvplot for dashboards for last two years in my company but it's loading/rendering time in browser is always slow ......
Read more >
Bokeh - Quick Guide - Tutorialspoint
Bokeh - Quick Guide, Bokeh is a data visualization library for Python. ... This will render the line plot in 'sine.html' and will...
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
The IPython notebook is a browser-based interactive data analysis tool that can combine narrative, code, graphics, HTML elements, and much more into a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found