Skip to main content

(fork of) Runtime profiler for Streamlit, powered by pyinstrument

Project description

wfork-streamlit-profiler  🏄🏼

PyPi

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wfork_streamlit_profiler-1.4.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wfork_streamlit_profiler-1.4.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file wfork_streamlit_profiler-1.4.0.tar.gz.

File metadata

File hashes

Hashes for wfork_streamlit_profiler-1.4.0.tar.gz
Algorithm Hash digest
SHA256 1cb9e4c4fd17e0bdd7d3706a0951c466f21bb71af551becf8aaa038a9c8c9b94
MD5 1e235cc53761da8cfea7fbc3a4321176
BLAKE2b-256 bbeafd0688f94542ed6feb70705b69a15f243ce118866e2501e99a00b9b824cd

See more details on using hashes here.

File details

Details for the file wfork_streamlit_profiler-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wfork_streamlit_profiler-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03936e5e2e90e21e2b9f5ff68f4271e8c3e746677004c3eaaed7ce4877eb62f7
MD5 764a73ffe63ea78bafccf66206ddc06f
BLAKE2b-256 97a414345e8941d5292c8bde5d26e068e5be14025ecb8f5c0460cfe2b1b56072

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page