(fork of) Runtime profiler for Streamlit, powered by pyinstrument
Project description
wfork-streamlit-profiler 🏄🏼
Runtime profiler for Streamlit, powered by pyinstrument.
wfork-streamlit-profiler is a fork of streamlit-profiler 0.2.4. If there are any newer versions of the original streamlit-profiler, you should probably use those instead. See the original project's github for more: https://github.com/jrieke/streamlit-profiler
streamlit-profiler is a Streamlit component that helps you find out which parts of your app are slow. It profiles the code via pyinstrument and shows the results right within your Streamlit app.
⏱️ Live demo ⏱️
Installation
pip install wfork-streamlit-profiler
Usage
import streamlit as st
from wfork_streamlit_profiler import Profiler
with Profiler():
st.title("My app")
# ... other code
Or:
import streamlit as st
from wfork_streamlit_profiler import Profiler
p = Profiler()
p.start()
# ... other code
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.
Don't want the profiler to immediately display when you stop profiling? Initialize it with Profiler(auto_output_on_stop=False) instead, and call the .output_streamlit() method whenever you want it to display, instead. You can also set the async_mode of the profiler in the pyinstrument in the same constructor, whatever that means.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wfork_streamlit_profiler-1.1.0.tar.gz.
File metadata
- Download URL: wfork_streamlit_profiler-1.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ddef6d7438187abf07056d7e2649c48481ef7e6c8b1ae477b54b0c55f3cb628
|
|
| MD5 |
3b681a94669dd702ff7e70d0a86040ca
|
|
| BLAKE2b-256 |
7b31d3f7daaf939620cc573d1557379055de8cb25b95c87ac674f98800ca2a57
|
File details
Details for the file wfork_streamlit_profiler-1.1.0-py3-none-any.whl.
File metadata
- Download URL: wfork_streamlit_profiler-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
597fdf07a9af7b6ee265337b47c083e383ef39200b29fd003df9a2cd8211caa0
|
|
| MD5 |
d689a441ce469ea7c03c6e3ff201e372
|
|
| BLAKE2b-256 |
1c230106596a662029b66cfcac7f3a0556f9f387043455a1af87201654117155
|