Add profiling calls to stuff which is actually slow
authorAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 7 Apr 2018 15:43:23 +0000 (18:43 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 7 Apr 2018 15:43:23 +0000 (18:43 +0300)
src/cargo/ops/cargo_rustc/context/mod.rs
src/cargo/util/rustc.rs

index 958ccc21a303ff7f6180dc3c74441248b110d90b..389a0afd5473c383770baa8384ebe3748ef873a4 100644 (file)
@@ -197,6 +197,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
     /// Ensure that we've collected all target-specific information to compile
     /// all the units mentioned in `units`.
     fn probe_target_info(&mut self) -> CargoResult<()> {
+        let _p = profile::start("Context::probe_target_info");
         debug!("probe_target_info");
         let host_target_same = match self.requested_target() {
             Some(s) if s != self.config.rustc()?.host => false,
index 147212048d3cf93331c9112f15daad13c8c8d1a9..d9e8fe657dd869aa5bef7d16dccbcdf47ff80ae9 100644 (file)
@@ -1,6 +1,6 @@
 use std::path::PathBuf;
 
-use util::{self, internal, CargoResult, ProcessBuilder};
+use util::{self, internal, profile, CargoResult, ProcessBuilder};
 
 /// Information on the `rustc` executable
 #[derive(Debug)]
@@ -23,6 +23,8 @@ impl Rustc {
     /// If successful this function returns a description of the compiler along
     /// with a list of its capabilities.
     pub fn new(path: PathBuf, wrapper: Option<PathBuf>) -> CargoResult<Rustc> {
+        let _p = profile::start("Rustc::new");
+
         let mut cmd = util::process(&path);
         cmd.arg("-vV");