Skip to content
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

Tracking Issue for self-profile minimum viable product #58967

Closed
27 tasks done
michaelwoerister opened this issue Mar 6, 2019 · 6 comments
Closed
27 tasks done

Tracking Issue for self-profile minimum viable product #58967

michaelwoerister opened this issue Mar 6, 2019 · 6 comments
Labels
A-self-profile Area: Self-profiling feature of the compiler C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@michaelwoerister
Copy link
Member

michaelwoerister commented Mar 6, 2019

Goals for the first usable iteration of -Zself-profile are:

  • Make the compiler track query invocations and other important function calls (e.g. LLVM related)
    • This means tracking the query/function name (no query keys, arguments yet)
  • Reduce the overhead of tracking and profile generation as to not be prohibitive
    • This means emitting events in an optimized binary format
  • Write a post-processing tool that generates an aggregated report from the raw event data
    • The aggregated report is a table with one line per query/function and columns for
      • total time spent in the query (in milliseconds)
      • time spent in the query as percentage of total compile time
      • number of query invocations
      • percentage of in-memory cache hits
      • percentage of incremental cache hits
      • total time spent (milliseconds) in loading query results from incremental cache
      • total time spent (milliseconds) blocked on concurrent query invocations
  • Re-enable self-profiling on perf.rlo, which includes
    • running the postprocessing tool to generate the report for each test run
    • adding a new comparison view that compares the test runs of a single benchmark and shows changes per query. This view is reachable by clicking on a benchmark in the regular comparison view (i.e. one can "zoom" into a given benchmark)
  • Document how self-profiling works in the rustc-guide.

Non-Goals are:

  • Supporting self-profiling in 32-bit compilers -- this makes it easier to rely on things like memory mapped files
  • Tracking individual query keys/function arguments

Work packages resulting from this set of goals are:

Possible Problems that might arise are:

  • Profiling overhead keeps being too high - then we need to think about doing separate self-profile runs on perf.rlo

cc @wesleywiser @Mark-Simulacrum

@michaelwoerister michaelwoerister added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. A-self-profile Area: Self-profiling feature of the compiler labels Mar 6, 2019
@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 6, 2019
@mark-i-m
Copy link
Member

@michaelwoerister Could you add one more MVP item: document in rustc guide?

@michaelwoerister
Copy link
Member Author

Good call! Thanks for the reminder, @mark-i-m!

michaelwoerister pushed a commit to michaelwoerister/rust that referenced this issue Apr 12, 2019
wesleywiser added a commit to wesleywiser/rust that referenced this issue Apr 13, 2019
tmandry added a commit to tmandry/rust that referenced this issue Oct 11, 2019
…k-Simulacrum

self-profiling: Add events for metadata loading (plus a small dep-tracking optimization)

This PR
- adds self-profiling events related to loading things from crate metadata
- makes the compiler cache the `DepNodeIndex` of upstream crates, so that they don't have to be looked up over and over.

The commits are best reviewed in isolation.

Self-profiling tracking issue: rust-lang#58967

r? @Mark-Simulacrum
cc @wesleywiser
bors added a commit that referenced this issue Oct 14, 2019
self-profiling: Add events for metadata loading (plus a small dep-tracking optimization)

This PR
- adds self-profiling events related to loading things from crate metadata
- makes the compiler cache the `DepNodeIndex` of upstream crates, so that they don't have to be looked up over and over.

The commits are best reviewed in isolation.

Self-profiling tracking issue: #58967

r? @Mark-Simulacrum
cc @wesleywiser
@wesleywiser
Copy link
Member

I added references to -Zself-profile and measureme to the rustc-guide in rust-lang/rustc-dev-guide#430. I don't think we want to duplicate how-to-use measureme info there so I think that's probably sufficient for now to tick that box.

@michaelwoerister
Copy link
Member Author

Thanks, @wesleywiser!

I'd like to have some documentation on how event recording is implemented somewhere. The best place for that are the crate docs probably.

@wesleywiser
Copy link
Member

@michaelwoerister We've completed all of the above tasks. IMO, we've achieved the MVP. What do you think?

@michaelwoerister
Copy link
Member Author

Yes. There's always "one more thing" that could be done (e.g. adding the incl. time column to perf.rlo) but we have to stop somewhere :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-self-profile Area: Self-profiling feature of the compiler C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants