You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/profiling/with_rustc_perf.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,24 @@ You can use the following options for the `x perf` command, which mirror the cor
28
28
-`--profiles`: Select profiles (`Check`, `Debug`, `Opt`, `Doc`) which should be profiled/benchmarked.
29
29
-`--scenarios`: Select scenarios (`Full`, `IncrFull`, `IncrPatched`, `IncrUnchanged`) which should be profiled/benchmarked.
30
30
31
+
## Example profiling diff for external crates
32
+
It can be of interest to generate a local diff for two commits of the compiler for external crates.
33
+
To start, in the `rustc-perf` repo, build the collector, which runs the Rust compiler benchmarks as follows.
34
+
```
35
+
cargo build --release -p collector
36
+
```
37
+
After this the collector can be located in `.\target\release\collector`, can be run locally with `bench_local` and expects the following arguments:
38
+
-`<PROFILE>`: Profiler selection for how performance should be measured. For this example we will use Cachegrind.
39
+
-`<RUSTC>`: The Rust compiler revision to benchmark, specified as a commit SHA from `rust-lang/rust`.
40
+
Optional arguments allow running profiles and scenarios as described above. `--include` in `x perf` is instead `--exact-match`. More information regarding the mandatory and
41
+
optional arguments can be found in the [rustc-perf-readme-profilers].
42
+
43
+
Then, for the case of generating a profile diff for the crate `serve_derive-1.0.136`, for two commits `<SHA1>` and `<SHA2>` in the `rust-lang/rust` repository, run the following
0 commit comments