DynamicMap vs Bokeh CDS Performance

Hi all! I am trying to assess/poke around some more performance-oriented usage and I am having issues with hv.DynamicMap processing/handling a large number of points (10s of thousands via hv.Points); I am intentionally trying to stress the code/system to just learn some new things (and am intentionally not using something like datashader). I am finding that a DynamicMap is significantly slower than using Bokeh directly and swapping data in the ColumnDataSource.

Too much code to share here, so here is a link to the repo where I am testing things out. Not the cleanest/best code, but all functional. Files of note are main.py and main_bokeh.py; everything else is the C++ that is irrelevant wrt the performance of visualizations. (If you want to use the actual C++ model you’ll need the devcontainer, but otherwise there is a simple Python model included too that should be sufficient.)

For reference, on my laptop, the DynamicMap version starts to consistently breach the 33ms periodic callback period at around 10k-15k entities, but when using Bokeh directly it can go significantly higher before showing any sort of discernable performance loss.

Are there some tips or tricks for getting similar high performance directly with HoloViews?

Maybe submit an issue on HoloViews. I don’t have any comments since I don’t know much about DynamicMap internals.