Add misc timings
This commit is contained in:
parent
e3e4420906
commit
ead5cf11b8
3 changed files with 31 additions and 8 deletions
|
|
@ -33,6 +33,7 @@ use ty;
|
|||
use ty::maps::job::QueryResult;
|
||||
use ty::codec::{self as ty_codec, TyDecoder, TyEncoder};
|
||||
use ty::context::TyCtxt;
|
||||
use util::common::time;
|
||||
|
||||
const TAG_FILE_FOOTER: u128 = 0xC0FFEE_C0FFEE_C0FFEE_C0FFEE_C0FFEE;
|
||||
|
||||
|
|
@ -214,7 +215,7 @@ impl<'sess> OnDiskCache<'sess> {
|
|||
// Encode query results
|
||||
let mut query_result_index = EncodedQueryResultIndex::new();
|
||||
|
||||
{
|
||||
time(tcx.sess, "encode query results", || {
|
||||
use ty::maps::queries::*;
|
||||
let enc = &mut encoder;
|
||||
let qri = &mut query_result_index;
|
||||
|
|
@ -258,7 +259,9 @@ impl<'sess> OnDiskCache<'sess> {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
// Encode diagnostics
|
||||
let diagnostics_index = {
|
||||
|
|
@ -1125,6 +1128,11 @@ fn encode_query_results<'enc, 'a, 'tcx, Q, E>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
E: 'enc + TyEncoder,
|
||||
Q::Value: Encodable,
|
||||
{
|
||||
let desc = &format!("encode_query_results for {}",
|
||||
unsafe { ::std::intrinsics::type_name::<Q>() });
|
||||
|
||||
time(tcx.sess, desc, || {
|
||||
|
||||
for (key, entry) in Q::get_cache_internal(tcx).map.iter() {
|
||||
if Q::cache_on_disk(key.clone()) {
|
||||
let entry = match *entry {
|
||||
|
|
@ -1143,4 +1151,5 @@ fn encode_query_results<'enc, 'a, 'tcx, Q, E>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
}
|
||||
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -793,9 +793,13 @@ pub fn phase_2_configure_and_expand_inner<'a, F>(sess: &'a Session,
|
|||
let mut ecx = ExtCtxt::new(&sess.parse_sess, cfg, &mut resolver);
|
||||
let err_count = ecx.parse_sess.span_diagnostic.err_count();
|
||||
|
||||
let krate = ecx.monotonic_expander().expand_crate(krate);
|
||||
let krate = time(sess, "expand crate", || {
|
||||
ecx.monotonic_expander().expand_crate(krate)
|
||||
});
|
||||
|
||||
ecx.check_unused_macros();
|
||||
time(sess, "check unused macros", || {
|
||||
ecx.check_unused_macros();
|
||||
});
|
||||
|
||||
let mut missing_fragment_specifiers: Vec<_> =
|
||||
ecx.parse_sess.missing_fragment_specifiers.borrow().iter().cloned().collect();
|
||||
|
|
|
|||
|
|
@ -43,7 +43,11 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
|
|||
time(sess, "persist dep-graph", || {
|
||||
save_in(sess,
|
||||
dep_graph_path(sess),
|
||||
|e| encode_dep_graph(tcx, e));
|
||||
|e| {
|
||||
time(sess, "encode dep-graph", || {
|
||||
encode_dep_graph(tcx, e)
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +149,9 @@ fn encode_dep_graph(tcx: TyCtxt,
|
|||
tcx.sess.opts.dep_tracking_hash().encode(encoder)?;
|
||||
|
||||
// Encode the graph data.
|
||||
let serialized_graph = tcx.dep_graph.serialize();
|
||||
let serialized_graph = time(tcx.sess, "getting serialized graph", || {
|
||||
tcx.dep_graph.serialize()
|
||||
});
|
||||
|
||||
if tcx.sess.opts.debugging_opts.incremental_info {
|
||||
#[derive(Clone)]
|
||||
|
|
@ -221,7 +227,9 @@ fn encode_dep_graph(tcx: TyCtxt,
|
|||
println!("[incremental]");
|
||||
}
|
||||
|
||||
serialized_graph.encode(encoder)?;
|
||||
time(tcx.sess, "encoding serialized graph", || {
|
||||
serialized_graph.encode(encoder)
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -245,5 +253,7 @@ fn encode_work_products(dep_graph: &DepGraph,
|
|||
fn encode_query_cache(tcx: TyCtxt,
|
||||
encoder: &mut Encoder)
|
||||
-> io::Result<()> {
|
||||
tcx.serialize_query_result_cache(encoder)
|
||||
time(tcx.sess, "serialize query result cache", || {
|
||||
tcx.serialize_query_result_cache(encoder)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue