File tree Expand file tree Collapse file tree 2 files changed +13
-98
lines changed
Expand file tree Collapse file tree 2 files changed +13
-98
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
33## Internal profiler
44
5- Cargo has a basic, hierarchical profiler built-in. The environment variable
6- ` CARGO_PROFILE ` can be set to an integer which specifies how deep in the
7- profile stack to print results for.
5+ Cargo leverages [ tracing] ( https://crates.io/crates/tracing )
6+ as a basic, hierarchical built-in profiler.
87
9- ``` sh
10- # Output first three levels of profiling info
11- CARGO_PROFILE=3 cargo generate-lockfile
8+ Environment variables:
9+ - ` __CARGO_LOG_PROFILE=<true|1> ` : log tracing events to a file in the current working directory
10+ - ` __CARGO_LOG_PROFILE_CAPTURE_ARGS=<true|1> ` : include arguments in the events
11+
12+ At process exit, your trace will be in a file like ` trace-1668480819035032.json ` .
13+ Open that file with [ ui.perfetto.dev] ( https://ui.perfetto.dev ) (or chrome://tracing) to browse your trace.
14+
15+ Example:
16+ ``` console
17+ $ # Output first three levels of profiling info
18+ $ __CARGO_LOG_PROFILE=true cargo generate-lockfile
1219```
1320
1421## Benchmarking
You can’t perform that action at this time.
0 commit comments