From 649f0b71d5d634a85dfc56e2cf7d50c5fb2d1bae Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 7 Apr 2018 18:43:23 +0300 Subject: [PATCH] Add profiling calls to stuff which is actually slow --- src/cargo/ops/cargo_rustc/context/mod.rs | 1 + src/cargo/util/rustc.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cargo/ops/cargo_rustc/context/mod.rs b/src/cargo/ops/cargo_rustc/context/mod.rs index 958ccc21a..389a0afd5 100644 --- a/src/cargo/ops/cargo_rustc/context/mod.rs +++ b/src/cargo/ops/cargo_rustc/context/mod.rs @@ -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, diff --git a/src/cargo/util/rustc.rs b/src/cargo/util/rustc.rs index 147212048..d9e8fe657 100644 --- a/src/cargo/util/rustc.rs +++ b/src/cargo/util/rustc.rs @@ -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) -> CargoResult { + let _p = profile::start("Rustc::new"); + let mut cmd = util::process(&path); cmd.arg("-vV"); -- 2.30.2