You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would help (internal) tooling such as perf.rlo, since it avoids re-parsing rustc's output into proper data structures.
Implementation details
While the compiler could output each pass separately, this may be difficult to implement in practice (since it would require partial JSON serialization, something neither rustc-serialize or Serde support currently, as far as I know).
Alternatives
Changes to the formatting of -Ztime-passes may make it easier to parse.
Removing seemingly arbitrary indentation (at least from my perspective).
Some other changes? I have not interacted with the parsing code [yet]...
Would an alternate "switch" that makes all output from the compiler buffer into JSON (similar to the error system) be preferable?
Unresolved Questions
How should users find the start/end of JSON amid other output?
Both when using Cargo and rustc directly.
How should sub-pass timings be reflected? (Likely depends what is currently done).
@nrc seems to be generally in favor, from short discussion on IRC.
@Mark-Simulacrum The times are printed out as they are obtained. This means that the substages like codegen passes and function passes occur before the entire LLVM passes stage finishes. To do otherwise would require storing that substage data somewhere and not printing it out until the overall stage is done. The downside of doing this is that you don't get immediate feedback on the last substage that just happened, so if rustc is taking a very long time on one of the later substages, the user won't know how long the previous substages were until the overall stage is done. For the json version it is fine however because it is intended to be consumed by other programs and not used as a live view of rustc's current progress, so just collecting all the data and spitting out one big json at the end is fine.
While the compiler could output each pass separately, this may be difficult to implement in practice (since it would require partial JSON serialization, something neither rustc-serialize or Serde support currently, as far as I know).
Activity
nagisa commentedon Sep 3, 2016
Identation represents pass nesting. i.e. “llvm function passes[0]” is a part of “LLVM passes”.
Mark-Simulacrum commentedon Sep 3, 2016
@nagisa That makes sense, but (in general) indentation is expected to relate to the above item, not the one below.
Example below (I expect the llvm things to be below LLVM passes if indented)
retep998 commentedon Sep 3, 2016
@Mark-Simulacrum The times are printed out as they are obtained. This means that the substages like codegen passes and function passes occur before the entire LLVM passes stage finishes. To do otherwise would require storing that substage data somewhere and not printing it out until the overall stage is done. The downside of doing this is that you don't get immediate feedback on the last substage that just happened, so if rustc is taking a very long time on one of the later substages, the user won't know how long the previous substages were until the overall stage is done. For the json version it is fine however because it is intended to be consumed by other programs and not used as a live view of rustc's current progress, so just collecting all the data and spitting out one big json at the end is fine.
Mark-Simulacrum commentedon Sep 3, 2016
I understand why it's the way it is; I was just clarifying that to me the indentation is initially misleading.
If the indented passes are sub-passes, are they reflected in the total time of the parent pass? (added an unresolved question about this).
nagisa commentedon Sep 3, 2016
Yes they are.
dtolnay commentedon Feb 16, 2017
Serde 0.8 and 0.9 both support this. 😁
Mark-Simulacrum commentedon Jul 28, 2019
Closing. We have the new self-profile infrastructure which more or less makes this no longer necessary.