I’ve developed an app but I see that it works in local slowly. I guess, root cause of this problem is the code runs after every single action in the app throughly. I think that it is a common case for streamliters (You know, there is a “running…” text in the upper right corner of the screen and it makes you wait for a while.). Anyway, I’ve noticed that when I deploy my app in the Streamlit Cloud, the speed issue is gone. Why did I face this problem and how can I fix it in my local?
Any ideas or experiences? I really love using streamlit, but I’m tired of facing this issue and it gets me down.
For instance, I’m filtering my dataset via selectboxes but I have to wait for a while after making each selectbox selection.
Is there a difference between local and cloud? Because I realize that there is a performance difference between the same projects running in two different platforms (local and cloud). How can I ensure high app performance in my local as in the cloud?
st.cache is a solution that improves app performance but it can’t prevent the rerun of other streamlit components.
By the way, the main issue is not “re-run”. Why does the same code run and respond in the cloud quicker? If there is a default limitation in the local, how can I increase my resources?
The specs of my computer are:
Processor: Intel(R) Core™ İ5-6200U CPU @ 2.30GHz 2.40 GHz
RAM: 8 GB
System type: 64-bit operating system, x64-based processor
Windows 10 Enterprise
For instance, I need to wait about 4 seconds after every single selection for the ‘running’ text to disappear in the simple app above. (After every selection, this app filters the selected dataframe.) Sometimes when I make selections of all fields without waiting, all of a sudden the page refreshes itself and I have to make my choices again
We experienced the same issue, although we tried to run another streamlit app on a much more stronger machine. (32 CPU, 128 GB RAM, Ubuntu 18.04)
By the way, there is no resource limitation for us, if we decide to deploy a streamlit app on-prem. What would you recommend? What are the recommended system requirements for streamliters who run their apps on local?
Maybe it would help to put all your select boxes into a st.form. In this way you could make all your selections and apply them at once which would improve the user experience.
In that case, I’m not sure what to even suggest. Your machine is likely 2-4x the resources of the container that is running the Streamlit Cloud app. But then you say you tried on Ubuntu, which feels like it eliminating being an operating system issue.
So we’ve eliminated (?) operating system, resources and code (since it’s the same code)…not sure what else to say other than @thunderbug1 's suggestion of evaluating how you are processing the inputs. Is there code you can share that demonstrates the issue?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.