App Continues to take long and more cpu resourse when it continues to run

When running the app the long it runs the mrore cpu resources that it takeup as actions are used from the buttons.

Need to find a way to fix this cpu hogginh problem any advice will be useful and helpful

Hi @sweetrush

Check out this blog on optimizing your app so that it runs more optimally:

Also, you may also try profiling the app using the streamlit-profiler component:

Hope this helps!

1 Like

Thanks @dataprofessor This will be very helpfull , I have only been learning Streamlit for only a few weeks, and it is really great. thank you for the assist and guidance

@dataprofessor Thanks again for this very useful information

I actully found out using the streamlit profiler what was causing the hangup.
So its a learning experiance but this is what happen.

I had a created a function that would track the code excution in terms of printing out where the code run is at using the print(Message) native to python.

cause i had so many instance of this function through out the program it kind of was looping in some way and appending to the memory or cache as it was running.

I think streamlit does not like me using the native print()

  • One Bottle neck down a few more to go.

But the tools and links shared are very very helpful for me who is a noob at streamlit.
Thanks again everyone

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.