Add tracing to various miscellaneous functions #145306
Open
+9
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds tracing to:
ty.fn_sig()
. There is only one place wherefn_sig
is called for real withinrustc_const_eval
. There are three other places where it's called, but one is insideConstCx::fn_sig
(which does not seem to be used anywhere), another is underif cfg!(debug_assertions)
, and the last is withincall_main
and thus gets called only once.find_mir_or_eval_fn
Const.eval()
within the Miri or therustc_const_eval
codebase.Those are all quite long-lived operations, that in total make up for 6-7% of the total time spent in the program. I found out about them by looking for long periods of time that were previously not traced at all, using this SQL query in ui.perfetto.dev:
How the table was obtained
The above image was obtained in ui.perfetto.dev with the following SQL query after obtaining a trace file by running Miri on the following Rust code with
n=100
.r? @RalfJung