Ways to speed up rendering of many figures

Hi,

I’m curious what methods there are to speed up the rendering of many plots using Bokeh server, e.g. 30+ plots

I’m working with the pivot tool I contributed, bokeh/examples/app/pivot, and have noticed that many plots takes a while to render. If you’d like to reproduce the specific performance issues I’m talking about, follow these steps:

  1. Pull latest Bokeh git repo: GitHub - bokeh/bokeh: Interactive Data Visualization in the browser, from Python
  2. Launch “pivot” example app, e.g: bokeh serve --show bokeh/examples/app/pivot
  3. Configure widgets as shown in attached screenshot and listed here:
  • X-Axis: Region
  • Y-Axis: Electricity Generation
  • Separate Series by: Case
  • Explode By: Year
  • Group Exploded Charts By: Technology
  • Chart Type: Dot
    This configuration produces 30 plots, and for me it takes around 30 seconds to render the plots.

However, I noticed that it takes only 8 seconds to render the same data in this configuration (which produces only 6 plots):

  • X-Axis: Year
  • Y-Axis: Electricity Generation
  • Separate Series by: Technology
  • Explode By: Case
  • Group Exploded Charts By: Region
  • Chart Type: Dot

I’m planning to profile the code to find where the bottlenecks are, but up front I’m curious if there are general performance suggestions/resources you may have for this type of application.

Thanks!

Following up on this,

Updating to the latest bokeh 0.12.5, it looks like the update time has improved from ~30 seconds to ~15 seconds for the first example above that produces 30 plots. But I also added a timer to the pivot app update function update_plots() and noticed that it takes only ~1.4 seconds to run that entire function, which includes the update to children of the plots area (bokeh.layouts.column). So the bulk of the time seems to be spent outside of the pivot app code, rendering the plots. (I’m using Python 2.7, by the way)

Was there some recent change that improved speed of rendering charts? Are there any efforts in the works to increase speed even more? I’d be interested in helping out with this if I can (not sure if I have the time/required knowledge).

Thanks.

···

On Wednesday, May 10, 2017 at 3:30:58 AM UTC-4, Matt Mowers wrote:

Hi,

I’m curious what methods there are to speed up the rendering of many plots using Bokeh server, e.g. 30+ plots

I’m working with the pivot tool I contributed, bokeh/examples/app/pivot, and have noticed that many plots takes a while to render. If you’d like to reproduce the specific performance issues I’m talking about, follow these steps:

  1. Pull latest Bokeh git repo: https://github.com/bokeh/bokeh
  2. Launch “pivot” example app, e.g: bokeh serve --show bokeh/examples/app/pivot
  3. Configure widgets as shown in attached screenshot and listed here:
  • X-Axis: Region
  • Y-Axis: Electricity Generation
  • Separate Series by: Case
  • Explode By: Year
  • Group Exploded Charts By: Technology
  • Chart Type: Dot
    This configuration produces 30 plots, and for me it takes around 30 seconds to render the plots.

However, I noticed that it takes only 8 seconds to render the same data in this configuration (which produces only 6 plots):

  • X-Axis: Year
  • Y-Axis: Electricity Generation
  • Separate Series by: Technology
  • Explode By: Case
  • Group Exploded Charts By: Region
  • Chart Type: Dot

I’m planning to profile the code to find where the bottlenecks are, but up front I’m curious if there are general performance suggestions/resources you may have for this type of application.

Thanks!

Hi,

I'm not sure offhand what might expand the difference. If the data sizes are more medium-ish or larger, the base64 array protocol might explain the difference, if your old version predates that. We are always interested in improving the performance. Right now it's clear that some of our eventing is muddled and some work especially around layout is being needlessly duplicated. One of our devs is working hard to clean up a lot of the very lowest level BokehJS code and he is hopeful that there are still significant improvements to be had (if not in 0.12.6 then in a release soon after). Apart from layout and event work, there is also a plan to move to a full binary array protocol. There is a high level plan for this, and I'd certainly appreciate help with this, however it is still a fairly involved task. But if you are interested in looking at it I am happy to discuss details.

Thanks,

Bryan

···

On May 25, 2017, at 13:25, Matt Mowers <[email protected]> wrote:

Following up on this,

Updating to the latest bokeh 0.12.5, it looks like the update time has improved from ~30 seconds to ~15 seconds for the first example above that produces 30 plots. But I also added a timer to the pivot app update function update_plots() and noticed that it takes only ~1.4 seconds to run that entire function, which includes the update to children of the plots area (bokeh.layouts.column). So the bulk of the time seems to be spent outside of the pivot app code, rendering the plots. (I'm using Python 2.7, by the way)

Was there some recent change that improved speed of rendering charts? Are there any efforts in the works to increase speed even more? I'd be interested in helping out with this if I can (not sure if I have the time/required knowledge).

Thanks.

On Wednesday, May 10, 2017 at 3:30:58 AM UTC-4, Matt Mowers wrote:
Hi,

I'm curious what methods there are to speed up the rendering of many plots using Bokeh server, e.g. 30+ plots

I'm working with the pivot tool I contributed, bokeh/examples/app/pivot, and have noticed that many plots takes a while to render. If you'd like to reproduce the specific performance issues I'm talking about, follow these steps:
  • Pull latest Bokeh git repo: https://github.com/bokeh/bokeh
  • Launch "pivot" example app, e.g: bokeh serve --show bokeh/examples/app/pivot
  • Configure widgets as shown in attached screenshot and listed here:
    • X-Axis: Region
    • Y-Axis: Electricity Generation
    • Separate Series by: Case
    • Explode By: Year
    • Group Exploded Charts By: Technology
    • Chart Type: Dot
This configuration produces 30 plots, and for me it takes around 30 seconds to render the plots.

However, I noticed that it takes only 8 seconds to render the same data in this configuration (which produces only 6 plots):
    • X-Axis: Year
    • Y-Axis: Electricity Generation
    • Separate Series by: Technology
    • Explode By: Case
    • Group Exploded Charts By: Region
    • Chart Type: Dot

I'm planning to profile the code to find where the bottlenecks are, but up front I'm curious if there are general performance suggestions/resources you may have for this type of application.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/49fdb218-da2e-4fe5-9fab-cf3f5d5a7f64%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.