Speed of rendering content in tabs vs multipage apps

Hi all,

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?

Thanks for help in advance!

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.

1 Like

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.

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