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

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

Merged
merged 4 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ impl<'a> CrateLoader<'a> {
dep_kind: DepKind,
name: Symbol
) -> (CrateNum, Lrc<cstore::CrateMetadata>) {
let _prof_timer =
self.sess.prof.generic_activity("metadata_register_crate");

let crate_root = lib.metadata.get_root();
self.verify_no_symbol_conflicts(span, &crate_root);

Expand Down
5 changes: 5 additions & 0 deletions src/librustc_metadata/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ macro_rules! provide {
$tcx: TyCtxt<$lt>,
def_id_arg: T,
) -> <ty::queries::$name<$lt> as QueryConfig<$lt>>::Value {
let _prof_timer =
$tcx.prof.generic_activity("metadata_decode_entry");
Mark-Simulacrum marked this conversation as resolved.
Show resolved Hide resolved

#[allow(unused_variables)]
let ($def_id, $other) = def_id_arg.into_args();
assert!(!$def_id.is_local());
Expand Down Expand Up @@ -444,6 +447,8 @@ impl cstore::CStore {
}

pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro {
let _prof_timer = sess.prof.generic_activity("metadata_load_macro");

let data = self.get_crate_data(id.krate);
if data.is_proc_macro_crate() {
return LoadedMacro::ProcMacro(data.load_proc_macro(id.index, sess));
Expand Down