Efficient updates of image plots in Bokeh for interactive visualization

Deadly 提交于 2019-12-04 05:21:28

As others have mentioned, an efficient binary array protocol has been implemented. So the answer is to upgrade to recent versions.

For completeness, here is a comparison of results.

With 0.12.3 (the version from the original post — make sure to use tornado < 4.5):

---- Total update time (secs): 0.14389 + Sources update times (secs): ['0.00943', '0.00962', '0.01100', '0.00908', '0.00004', '0.00975', '0.00984', '0.00997', '0.00946', '0.00926', '0.00912', '0.00898', '0.00900', '0.00908', '0.00999', '0.01014'] ^C

With 0.12.13 (the most recent version as of this time):

---- Total update time (secs): 0.01999 + Sources update times (secs): ['0.00157', '0.00231', '0.00131', '0.00143', '0.00114', '0.00123', '0.00109', '0.00118', '0.00116', '0.00102', '0.00113', '0.00118', '0.00099', '0.00099', '0.00104', '0.00104']

There is probably even more marginal improvement possible if all of the images are stored in different (length 1) columns of a single ColumnDataSource and updated at once, rather than iterating over several different data sources.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!