Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#120465 - blyxyas:selfprof-is_enabled, r=<try>
[PERF Experiment] Only create the self-profile infra if the profiler is actually enabled (only if `-Z self-profile`) Previously, we would use the [`Session::time`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/struct.Session.html#method.time) and this would just call `verbose_generic_activity(...)`, which would create an activity and all that... But all this effort would go unnoticed if the user didn't use the `-Z self-profile` feature. So, this PR checks for the profiler before trying to profile. From my benchmarks on a server, this should be a great performance improvement (Note: I tested this with a 12-thread custom multithreaded rustc-perf clone to mimick a compiler that a user might use, the results may change by using the single-threaded rustc-perf that bors currently uses)
- Loading branch information