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
Goals for the first usable iteration of
-Zself-profileare:Non-Goals are:
Work packages resulting from this set of goals are:
-Zself-profile(Allow to specify profiling data output directory as -Zself-profile argument. #61123)-Zself-profileTrait selection(removed this from the MVP for now)cache missescolumn should be removed,invocationsshould be renamed rustc-perf#529)incr. loading timecolumn (detailed view: Possible bug in "totals" line for incr. comp. cache loading rustc-perf#527)summarize(Event recording & summarize need cleanup with respect to self-time vs incr-load-time vs blocked-time vs total-time. measureme#75)Possible Problems that might arise are:
self-profileruns on perf.rlocc @wesleywiser @Mark-Simulacrum