Streamlit+PyDeck Performance Issues (compared to non-streamlit usage of Pydeck with local data object)
See original GitHub issueTLDR - 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).
Note: I am using streamlit v1.13 and pydeck 0.8.3b (with geojson layers).
For transparency I posted this here without any responses: https://discuss.streamlit.io/t/pydeck-performance-issues-with-streamlit-but-not-standalone/31434
But think that this is a legitimate issue as it was brought up in Jan 2021. While that issue is closed, there was no resolution - and the suggestion to render pydeck elements as raw embedded HTML e.g. via components.html(deck.to_html(as_string=True), height=600)
does improve performance but has other issues associated with it.
Community voting on feature requests enables the Streamlit team to understand which issues are most important to our users.
If you’d like the Streamlit team to prioritize this issue, please use the 👍 (thumbs up emoji) reaction in response to the initial post.
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:7
Top GitHub Comments
@KeeonTabrizi Big thanks 😃 I was able to reproduce this here. This example will help us a lot to fix this.
@LukasMasuch please see my examples below.
Environment Requirements
Using Python 3.9.12.
Note: streamlit 1.13 is required because of a known compatibility issue with pydeck that was fixed with the 1.13 release. Additionally, pydeck 0.8.x is what introduced geojson support which is required for my use case.
This includes 3 examples in a streamlit app:
Note the example below is something I’ve adapted to demonstrate the issue. The singular geojson layer in question I loaded into a github gist which contains a valid 8.8MB geojson object of CA Zipcodes and some metadata in the properties.