Description
Proposal
I would like to add new a option to the --json
compiler flag, called e.g. timings
, which would print a JSON message with a very high-level overview of the time spent in individual sections of the compilation (e.g. frontend/backend/debuginfo generation/linking). This information could be then processed e.g. by Cargo and displayed in cargo build --timings
(rust-lang/cargo#14265, rust-lang/cargo#10643), to help Rust users more easily diagnose where is the bottleneck in their compilation pipeline.
In terms of implementation, I'm imagining a very slimmed down version of -Zself-profile
that is very cheap. Essentially just wrap the frontend/backend/linker sections of the compiler and output their wall-time duration.
Mentors or Reviewers
Process
The main points of the Major Change Process are as follows:
- File an issue describing the proposal.
- A compiler team member or contributor who is knowledgeable in the area can second by writing
@rustbot second
.- Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a
-C flag
, then full team check-off is required. - Compiler team members can initiate a check-off via
@rfcbot fcp merge
on either the MCP or the PR.
- Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a
- Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.
You can read more about Major Change Proposals on forge.