Mercurial > hg-stable
changeset 47132:c92e63762573
dirstate-tree: Add #[timed] attribute to `status` and `DirstateMap::read`
When running with a `RUST_LOG=trace` environment variable, the `micro_timer`
crate prints the duration taken by each call to functions with that attribute.
Differential Revision: https://phab.mercurial-scm.org/D10552
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Tue, 27 Apr 2021 17:49:38 +0200 |
parents | 60d852ae7e7b |
children | 15395fd8ab28 |
files | rust/hg-core/src/dirstate_tree/dirstate_map.rs rust/hg-core/src/dirstate_tree/status.rs |
diffstat | 2 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs Tue Apr 27 14:20:48 2021 +0200 +++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs Tue Apr 27 17:49:38 2021 +0200 @@ -1,4 +1,5 @@ use bytes_cast::BytesCast; +use micro_timer::timed; use std::path::PathBuf; use std::{collections::BTreeMap, convert::TryInto}; @@ -499,6 +500,7 @@ self.dirty_parents = true; } + #[timed] fn read<'a>( &mut self, file_contents: &'a [u8],
--- a/rust/hg-core/src/dirstate_tree/status.rs Tue Apr 27 14:20:48 2021 +0200 +++ b/rust/hg-core/src/dirstate_tree/status.rs Tue Apr 27 17:49:38 2021 +0200 @@ -13,6 +13,7 @@ use crate::PatternFileWarning; use crate::StatusError; use crate::StatusOptions; +use micro_timer::timed; use rayon::prelude::*; use std::borrow::Cow; use std::io; @@ -29,6 +30,7 @@ /// and its use of `itertools::merge_join_by`. When reaching a path that only /// exists in one of the two trees, depending on information requested by /// `options` we may need to traverse the remaining subtree. +#[timed] pub fn status<'tree>( dmap: &'tree mut DirstateMap, matcher: &(dyn Matcher + Sync),