PyDeck Performance Issues (with streamlit but not standalone)

TL;DR - Pydeck when used with Streamlit has poor performance when passing in local data (vs. external URL). These issues are not present with pydeck standalone.


I’ve noticed dramatically different performance when using PyDeck standalone through a jupyter notebook vs. within a streamlit app. When the data object passed to a PyDeck layer is a local array or dataframe the performance is substantially poorer (it’s fine with an external URL, but that’s not suitable for my use-case). I see similar reports of issues from Jan 2021 here: Poor Map Performance/Usability for 100k+ data points · Issue #2569 · streamlit/streamlit · GitHub

The solution in that github issue above was to pass the pydeck object output to HTML within a streamlit HTML component, but in my testing it doesn’t completely work and there are other issues that don’t make it viable.

Note: I am using streamlit v1.13 and pydeck 0.8.3b (with geojson layers).