Skip to content

Commit 33b3cee

Browse files
committed
Add profiling documentation to README.md
1 parent ecdbe04 commit 33b3cee

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ There also are some unit tests, you can run those with cargo:
105105
$ cargo test --all
106106
```
107107

108+
# Profiling
109+
110+
To profile rustpython, simply build in release mode with the `flame-it` feature.
111+
This will generate a file `flamescope.json`, which you can then view at
112+
https://speedscope.app.
113+
114+
```sh
115+
$ cargo run --release --features flame-it script.py
116+
$ cat flamescope.json
117+
{<json>}
118+
```
119+
120+
You can also pass the `--output-file` option to choose which file to output to
121+
(or stdout if you specify `-`), and the `--output-format` option to choose if
122+
you want to output in the speedscope json format (default), text, or a raw html
123+
viewer (currently broken).
124+
108125
# Using a standard library
109126

110127
As of now the standard library is under construction. You can

0 commit comments

Comments
 (0)