Goals:
- Think through data loading for different data sources
- Ensure your app is performant
Work in your Project team.
Use BigQuery for all your datasets. For each data source:
- What type of data loading will you use? Why? Explain as Markdown in your repository.
- Repeat the middle steps from Part 5.
Ensure each page of your app (if there are multiple) fully loads within two seconds.
-
Display the overall page load time using:
import time import streamlit as st start_time = time.time() # --- your page code here --- elapsed = time.time() - start_time st.caption(f"Page loaded in {elapsed:.2f} seconds")
-
You can use caching in Streamlit, but don't rely on that exclusively.
-
Timing Function[s] in Python can help you identify where the slowdown(s) are.
Hint
You may need to push logic/filtering from pandas to SQL to reduce the number of records that need to be loaded from the database by your app.Make a screen recording starting your app locally, then loading each page in real time. Some options for recording:
- Links to the pull request(s)
- The screen recording