Is there a difference in the speed that Streamlit renders content if you package content in tabs vs on separate pages?
This link in the very helpful docs suggests that “All the content of every tab is always sent to and rendered on the frontend.” so does that mean multipage is faster because only the current page is rendered?
Yes. When using tabs, you will render everything, across all tabs at once. If you instead use a multipage setup, you will only render one page at a time. If you don’t have anything too heavy going on, both should be pretty snappy.
However, when you start to add in processes that take time, case-by-case matters. If you have a lot of widgets and things on a page for a user to interact with, you may ask yourself if you really want to be rendering all those other tabs with every single click the user makes. On the other hand, if you are compiling a report in a single, long process and giving the user several pages that are “read only” then tabs might be desirable.
Great thanks for clarifying! I also didn’t realise that the tabs would re-render on every click of a widget. That’s quite an overhead. Not too bad if small, but yes much worse as the app gets bigger.
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.