Skip to content

Commit ba26418

Browse files
wesleywisermark-i-m
authored andcommitted
Improve "Profiling the compiler" docs
Add mentions and links to `rustc-perf` and `measureme`.
1 parent 3c0ddd7 commit ba26418

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/profiling.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Profiling the compiler
22

3-
This discussion talks about how profile the compiler and find out
4-
where it spends its time. If you just want to get a general overview,
5-
it is often a good idea to just add `-Zself-profile` option to the
6-
rustc command line. This will break down time spent into various
7-
categories. But if you want a more detailed look, you probably want
8-
to break out a custom profiler.
3+
This section talks about how to profile the compiler and find out where it spends its time.
4+
5+
Depending on what you're trying to measure, there are several different approaches:
6+
7+
- If you want to see if a PR improves or regresses compiler performance:
8+
- The [rustc-perf](https://github.com/rust-lang-nursery/rustc-perf) project makes this easy and can be triggered to run on a PR via the `@rustc-perf` bot.
9+
10+
- If you want a medium-to-high level overview of where `rustc` is spending its time:
11+
- The `-Zself-profile` flag and [measureme](https://github.com/rust-lang/measureme) tools offer a query-based approach to profiling.
12+
See [their docs](https://github.com/rust-lang/measureme/blob/master/summarize/Readme.md) for more information.
13+
14+
- If you want function level performance data or even just more details than the above approaches:
15+
- Consider using a native code profiler such as [perf](profiling/with_perf.html).
916

0 commit comments

Comments
 (0)