1
Fork 0

Introduce -Zprofile-closures to evaluate the impact of 2229

This creates a CSV with name "closure_profile_XXXXX.csv", where the
variable part is the process id of the compiler.

To profile a cargo project you can run one of the following depending on
if you're compiling a library or a binary:

```
cargo +stage1 rustc --lib -- -Zprofile-closures
cargo +stage1 rustc --bin -- -Zprofile-closures
```
This commit is contained in:
Aman Arora 2021-05-05 15:57:08 -04:00
parent 3e9d7ecf78
commit fc273e9bf2
9 changed files with 148 additions and 7 deletions

View file

@ -1209,6 +1209,8 @@ options! {
"show backtraces for panics during proc-macro execution (default: no)"),
profile: bool = (false, parse_bool, [TRACKED],
"insert profiling code (default: no)"),
profile_closures: bool = (false, parse_no_flag, [UNTRACKED],
"profile size of closures"),
profile_emit: Option<PathBuf> = (None, parse_opt_pathbuf, [TRACKED],
"file path to emit profiling data at runtime when using 'profile' \
(default based on relative source path)"),