Mercurial > hg
comparison rust/hg-core/src/dirstate_tree/status.rs @ 47118: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 |
comparison
equal
deleted
inserted
replaced
47117:60d852ae7e7b | 47118:c92e63762573 |
---|---|
11 use crate::EntryState; | 11 use crate::EntryState; |
12 use crate::HgPathBuf; | 12 use crate::HgPathBuf; |
13 use crate::PatternFileWarning; | 13 use crate::PatternFileWarning; |
14 use crate::StatusError; | 14 use crate::StatusError; |
15 use crate::StatusOptions; | 15 use crate::StatusOptions; |
16 use micro_timer::timed; | |
16 use rayon::prelude::*; | 17 use rayon::prelude::*; |
17 use std::borrow::Cow; | 18 use std::borrow::Cow; |
18 use std::io; | 19 use std::io; |
19 use std::path::Path; | 20 use std::path::Path; |
20 use std::path::PathBuf; | 21 use std::path::PathBuf; |
27 /// and variable names) and dirstate tree at the same time. The core of this | 28 /// and variable names) and dirstate tree at the same time. The core of this |
28 /// traversal is the recursive `traverse_fs_directory_and_dirstate` function | 29 /// traversal is the recursive `traverse_fs_directory_and_dirstate` function |
29 /// and its use of `itertools::merge_join_by`. When reaching a path that only | 30 /// and its use of `itertools::merge_join_by`. When reaching a path that only |
30 /// exists in one of the two trees, depending on information requested by | 31 /// exists in one of the two trees, depending on information requested by |
31 /// `options` we may need to traverse the remaining subtree. | 32 /// `options` we may need to traverse the remaining subtree. |
33 #[timed] | |
32 pub fn status<'tree>( | 34 pub fn status<'tree>( |
33 dmap: &'tree mut DirstateMap, | 35 dmap: &'tree mut DirstateMap, |
34 matcher: &(dyn Matcher + Sync), | 36 matcher: &(dyn Matcher + Sync), |
35 root_dir: PathBuf, | 37 root_dir: PathBuf, |
36 ignore_files: Vec<PathBuf>, | 38 ignore_files: Vec<PathBuf>, |