Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamlit slows down with many nested blocks #9456

Open
4 tasks done
raethlein opened this issue Sep 12, 2024 · 1 comment
Open
4 tasks done

Streamlit slows down with many nested blocks #9456

raethlein opened this issue Sep 12, 2024 · 1 comment
Assignees
Labels
area:performance area:ux/ui priority:P2 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@raethlein
Copy link
Collaborator

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

In this forum discussion, we investigated an issue where a user app became slower after release 1.35.

It looks like the CSS styling introduced in this PR 5 is problematic and started to make rendering bigger apps using many blocks way slower.

Reproducible Code Example

No response

Steps To Reproduce

The issue can be reproduced by running the user's app from this repo: https://github.com/diogovalentte/mantium/tree/main
via Docker locally. The user has provided a database than can be copied to the postgres container in order to populate the app with enough data. I assume you could reproduce it with a simpler Streamlit app, but I haven't found the time yet.
However, when running the app with Streamlit 1.34 and with 1.38 you can notice a significant scroll speed difference even up to a point in which the app freezes. If you comment out the CSS selector from the linked lines of code above, the issue seems to be fixed.
Here are a few example commands (update the paths) where you can easily make the changes locally on your Mac and copy them into the container to test changes:

# [On your local Mac] 
## Build the frontend
cd frontend
yarn build

## copy the build artifacts into the container
docker cp ~/Projects/streamlit/frontend/app/build/ mantium-dashboard:/usr/local/lib/python3.10/site-packages/streamlit/static/

## Open bash in container
docker exec -it mantium-dashboard /bin/bash  

# [In container]

## Remove the current frontend assets
rm -rf /usr/local/lib/python3.10/site-packages/streamlit/static/*

## Move the copied-from-Mac frontend assets into the container
mv /usr/local/lib/python3.10/site-packages/streamlit/static/build/ /usr/local/lib/python3.10/site-packages/streamlit/static

Expected Behavior

Scrolling through the app should not make the browser window freeze and/or be super slow.

Current Behavior

No response

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version:
  • Python version:
  • Operating System:
  • Browser:

Additional Information

No response

@raethlein raethlein added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team status:confirmed Bug has been confirmed by the Streamlit team labels Sep 12, 2024
Copy link

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

@raethlein raethlein added priority:P2 and removed status:needs-triage Has not been triaged by the Streamlit team labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:performance area:ux/ui priority:P2 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants