A word on performance #56
Replies: 4 comments
-
tagging @mateusccoelho whom I was in discussion in #17 about future performance improvements in streamlit |
Beta Was this translation helpful? Give feedback.
-
Threw the full log results into GPT for analysis. Pretty interesting Performance Analysis Summary of Streamlit_analytics2: After a thorough analysis of the updated log data for Streamlit_analytics2, we've identified key areas where performance optimizations can significantly impact overall application efficiency. Here are the most interesting findings:
This analysis provides a roadmap for targeted performance optimizations in streamlit-analytics2. By addressing the identified areas, we can enhance the efficiency and responsiveness of the application, improving the user experience. |
Beta Was this translation helpful? Give feedback.
-
Now as a reminder, this all happens every single time any button or input is given into streamlit, since the script gets rerun.
|
Beta Was this translation helpful? Give feedback.
-
I have opened a few branches for some feature development (every branch starting with dev/) and have some interesting findings.
When a user clicks on a single button, it makes numerous function calls, which is expected since that is how streamlit has been designed.
You can see below the order and time of which functions are called when a single button is clicked (tested on the examples/minimal.py button)
You can see:
This is in total 80 function calls, on EVERY button click.
Most notably, the way the current code works is to intercept any streamlit function calls, monkey wrap them, increment a dictionary of widget counts and update st.session state.
I do think there is room to be selective on monkey patching for individual functions. IE, to wrap only st.button when its called instead of wrapping and monkey patching every single widget.
I am tracking these UUIDS and times in order to track performance improvements.
Interested to hear your thoughts and ideas for performance improvements
Beta Was this translation helpful? Give feedback.
All reactions