Add --json=timings
option to print build timings
#873
Labels
major-change
A proposal to make a major change to rustc
major-change-accepted
A major change proposal that was accepted
T-compiler
Add this label so rfcbot knows to poll the compiler team
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 incargo 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
@Mark-Simulacrum
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
The text was updated successfully, but these errors were encountered: