bokeh server very slow to render, even with small number of points.

Hi,

I am trying to use bokeh for linked brushing. I basically started with the stock_app example and modified it to do what I want. It works, but is very slow to update the plots. I put some timing stuff to check if it is my processing, but that takes tens of milliseconds while it often takes 5-10 seconds to actually update the plot. Here is what gets output to the terminal when I click on a point (I am using the tap tool).

Time to convert T_run to dataframe: 0.0018630027771 s

Time to retrieve ccf with requested parameters: 0.00530815124512 s

Time to make ccf plot: 0.0179259777069 s

INFO:tornado.access:200 PATCH /bokeh/bb/acd80d7a-70c3-43cf-81f5-ce7190f35216/ColumnDataSource/97903363-1e49-4f39-bfc4-cd557c295b5a/ (127.0.0.1) 4726.22ms

INFO:bokeh.server.views.backbone:loading done 50

INFO:tornado.access:200 PUT /bokeh/bb/acd80d7a-70c3-43cf-81f5-ce7190f35216/ToolEvents/a85fa0ca-2db4-4de6-a427-1e1a04a09468/ (127.0.0.1) 4681.86ms

It looks like what is taking so long is coming from the bokeh-server magic. There are only about 1000 points, so I wouldn’t expect it to be slow because of that, right? Is there something I might be doing wrong in the plot calls, or is it just a limitation from the browser or something? I am using bokeh 0.8.0.

In case you need it, my code is all on github: https://github.com/kgullikson88/General/blob/master/CCF_Widget.py

Thanks!

Kevin

Hey Kevin,

I just glanced through your code, but you are re-creating the entire plot and adding all of the components to the document upon every single change event. This is undoubtedly what’s causing the slowdown.

In the change handlers, you just need to grab the data sources off of self.mainplot (or whatever), update their data values, and then save them back into the document.

-Peter

···

On Thu, Feb 26, 2015 at 12:16 PM, [email protected] wrote:

Hi,

I am trying to use bokeh for linked brushing. I basically started with the stock_app example and modified it to do what I want. It works, but is very slow to update the plots. I put some timing stuff to check if it is my processing, but that takes tens of milliseconds while it often takes 5-10 seconds to actually update the plot. Here is what gets output to the terminal when I click on a point (I am using the tap tool).

Time to convert T_run to dataframe: 0.0018630027771 s

Time to retrieve ccf with requested parameters: 0.00530815124512 s

Time to make ccf plot: 0.0179259777069 s

INFO:tornado.access:200 PATCH /bokeh/bb/acd80d7a-70c3-43cf-81f5-ce7190f35216/ColumnDataSource/97903363-1e49-4f39-bfc4-cd557c295b5a/ (127.0.0.1) 4726.22ms

INFO:bokeh.server.views.backbone:loading done 50

INFO:tornado.access:200 PUT /bokeh/bb/acd80d7a-70c3-43cf-81f5-ce7190f35216/ToolEvents/a85fa0ca-2db4-4de6-a427-1e1a04a09468/ (127.0.0.1) 4681.86ms

It looks like what is taking so long is coming from the bokeh-server magic. There are only about 1000 points, so I wouldn’t expect it to be slow because of that, right? Is there something I might be doing wrong in the plot calls, or is it just a limitation from the browser or something? I am using bokeh 0.8.0.

In case you need it, my code is all on github: https://github.com/kgullikson88/General/blob/master/CCF_Widget.py

Thanks!

Kevin

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/5404e880-12aa-44db-b1fe-b702b4e60f45%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.