-
Notifications
You must be signed in to change notification settings - Fork 13.3k
JSON version of -Ztime-passes #36233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Identation represents pass nesting. i.e. “llvm function passes[0]” is a part of “LLVM passes”. |
@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)
|
@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. |
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). |
Yes they are. |
Serde 0.8 and 0.9 both support this. 😁 |
Closing. We have the new self-profile infrastructure which more or less makes this no longer necessary. |
Summary
A
-Ztime-passes-json
(likely bikeshed on naming, relatedly-Zsave-analysis-api
has been accepted) would produce:Motivation
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
-Ztime-passes
may make it easier to parse.Unresolved Questions
@nrc seems to be generally in favor, from short discussion on IRC.
The text was updated successfully, but these errors were encountered: