https://github.com/jrieke/streamlit-profiler
🏄🏼 Runtime profiler for Streamlit, powered by pyinstrument
https://github.com/jrieke/streamlit-profiler
Last synced: about 2 months ago
JSON representation
🏄🏼 Runtime profiler for Streamlit, powered by pyinstrument
- Host: GitHub
- URL: https://github.com/jrieke/streamlit-profiler
- Owner: jrieke
- License: mit
- Created: 2021-12-18T23:01:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T18:45:29.000Z (over 1 year ago)
- Last Synced: 2024-12-17T03:19:12.326Z (10 months ago)
- Language: Python
- Homepage:
- Size: 562 KB
- Stars: 40
- Watchers: 2
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# streamlit-profiler 🏄🏼
[](https://pypi.org/project/streamlit-profiler/)
**Runtime profiler for Streamlit, powered by [pyinstrument](https://github.com/joerick/pyinstrument).**
streamlit-profiler is a [Streamlit component](https://streamlit.io/components) that
helps you find out which parts of your app are slow. It profiles the code via
[pyinstrument](https://github.com/joerick/pyinstrument) and shows the results right
within your Streamlit app.Alpha version, use with care.
---
⏱️ Live demo ⏱️---
## Installation
```bash
pip install streamlit-profiler
```## Usage
```python
import streamlit as st
from streamlit_profiler import Profilerwith Profiler():
st.title("My app")
# ... other code# Or:
# p = Profiler()
# p.start()
# ...
# p.stop()
```Then start your app as usual: `streamlit run my_app.py`
The `Profiler` class is an extension of `pyinstrument.Profiler`, so you can use
[all of its functions](https://pyinstrument.readthedocs.io/en/latest/reference.html#pyinstrument.Profiler).