Skip to content

Commit 9cc65a9

Browse files
Merge pull request #328 from egraphs-good/py-spy
Add support for profiling
2 parents 239a9f5 + c6efaf0 commit 9cc65a9

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/contributing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ make docs
7777
To debug the Rust parts of this project, follow the [PyO3 debugging guide](https://pyo3.rs/main/debugging.html#debugger-specific-setup).
7878
Debug symbols are turned on by default.
7979

80+
### Performance
81+
82+
[`py-spy`](https://github.com/benfred/py-spy) is installed as a development dependency and can be used to profile Python code.
83+
If there is a performance sensitive piece of code, you could isolate it in a file and profile it locally with:
84+
85+
```bash
86+
uv run py-spy record --format speedscope -- python tmp.py
87+
```
88+
8089
### Making changes
8190

8291
All changes that impact users should be documented in the `docs/changelog.md` file. Please also add tests for any new features

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,8 @@ exclude_also = [
274274

275275
[tool.uv.workspace]
276276
members = ["egglog"]
277+
278+
[dependency-groups]
279+
dev = [
280+
"py-spy>=0.4.1",
281+
]

uv.lock

Lines changed: 24 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)