Hi guys,
I have recently experienced a performance issue trying to update several small image plots at interactive frame rates. I would like to achieve around 10 frames per second running the server in localhost, but I can’t get more than 3-4. I’m opening this thread here since I didn’t get any reply to my question in stackoverflow:
In my application, I have a gridplot with 4x4 image plots of 64x64 elements and the data changes continuously according to some user interaction. I update the ColumnDataSources of the plot by replacing the data dict with a new one, doing something like this:
def update():
…
for row in grid:
for col in row:
…
new_data = {‘image’: new_image}
sources[row + “_” + col].data = new_data
``
I’ve posted a minimal working example in the SO post, simulating the user interaction with a periodic callback and I get a consistent time of ~300ms per frame, no matter what. Is this the expected performance or am I doing something wrong?
If my code is ok, I suspect the JSON encoding/decoding is the cause. I’m also aware of the ongoing discussion about improving the image plot sync performance by using base64 encoding:
https://github.com/bokeh/bokeh/issues/2204
https://github.com/bokeh/bokeh/pull/5429
and I would like to know if there is any realistic plan to use the base64 encoding in master soon. Actually, if some changes are needed in the synchronization mechanism to use base64 encoding for image plots, why not to leverage this opportunity and use base64 for any numeric column in a ColumnDataDource? I guess that if the columns are sent individually as 1d arrays, just using a base64 encoding could improve the performance without too many additional changes.
Thanks,
Enrique
Bokeh version: 0.12.3
Python version: 2.7.12
OS: Mac OSX 10.11.6 (El Capitan)

