Document profiling and tracing-durations-export (#1234)

Profiling is already extensively documented in ruff, so we can just link
to that guide. I added `tracing-durations-export` to the guide because i
found it a useful tool for optimizing.
This commit is contained in:
konsti 2024-02-04 22:57:16 +01:00 committed by GitHub
parent 0e35041ccd
commit 8116f6131a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 0 deletions

View File

@ -74,3 +74,19 @@ docker run --rm -it -v $(pwd):/app puffin-builder /app/target/x86_64-unknown-lin
We recommend using this container if you don't trust the dependency tree of the package(s) you are trying to resolve or install. We recommend using this container if you don't trust the dependency tree of the package(s) you are trying to resolve or install.
## Profiling
Please refer to Ruff's [Profiling Guide](https://github.com/astral-sh/ruff/blob/main/CONTRIBUTING.md#profiling-projects), it applies to Puffin, too.
### Analysing concurrency
You can use [tracing-durations-export](https://github.com/konstin/tracing-durations-export) to visualize parallel requests and find any spots where Puffin is CPU-bound. Example usage, with `puffin` and `puffin-dev` respectively:
```bash
RUST_LOG=puffin=info TRACING_DURATIONS_FILE=target/traces/jupyter.ndjson cargo run --features tracing-durations-export --profile profiling -- pip compile scripts/requirements/jupyter.in
```
```bash
RUST_LOG=puffin=info TRACING_DURATIONS_FILE=target/traces/jupyter.ndjson cargo run --features tracing-durations-export --bin puffin-dev --profile profiling -- resolve jupyter
```