What problem does it solve?
Slow Streamlit apps that rerun too much, load heavy data on every interaction, or consume excessive memory are time-consuming for users and costly to operate; this Skill explains patterns to reduce unnecessary reruns and resource consumption.
Core Features & Use Cases
- Caching patterns: Guidance on using @st.cache_data for computed data and @st.cache_resource for connections, models, and non-serializable objects while avoiding shared-mutation pitfalls.
- Cache management: Recommendations for TTL, max_entries, and cleanup handlers to prevent unbounded growth and stale results.
- Execution isolation: Use fragments to limit reruns to self-contained UI pieces and forms to batch inputs so typing or multiple controls don't trigger full reruns.
- Conditional rendering & large-data strategies: Techniques to avoid rendering heavy content unless needed, sample large datasets for exploration, and prefer databases/materialized views for very large workloads.
- Concurrency and threading guidance: Notes on safe multithreading patterns that avoid calling Streamlit APIs from background threads.
- Use case: Convert a dashboard that reloads entire pages on each filter change into a responsive dashboard using cached data loaders, fragment-isolated metrics, and form-submitted filters.
Quick Start
Use the optimizing-streamlit-performance skill to add caching, fragment isolation, and form batching to a slow Streamlit dashboard that reloads on every interaction.