1 # Profiling the compiler
3 This section talks about how to profile the compiler and find out where it spends its time.
5 Depending on what you're trying to measure, there are several different approaches:
7 - If you want to see if a PR improves or regresses compiler performance:
8 - The [rustc-perf](https://github.com/rust-lang/rustc-perf) project makes this easy and can be triggered to run on a PR via the `@rustc-perf` bot.
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.
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).