diff rust/hg-core/src/matchers.rs @ 44541:d880805d5442

hg-core: add function timing information This change makes use of the newly added logging infrastructure to trace the execution time of some important calls. This approach is very much complementary to using a profiler and will not guard against out-of-order execution or other kinds of compiler optimizations. That said, it is useful to get a rough high-level idea of where time is spent. Differential Revision: https://phab.mercurial-scm.org/D8253
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 06 Mar 2020 18:08:23 +0100
parents 483fce658e43
children 496868f1030c
line wrap: on
line diff
--- a/rust/hg-core/src/matchers.rs	Fri Mar 06 18:08:13 2020 +0100
+++ b/rust/hg-core/src/matchers.rs	Fri Mar 06 18:08:23 2020 +0100
@@ -24,6 +24,7 @@
     PatternSyntax,
 };
 
+use micro_timer::timed;
 use std::collections::HashSet;
 use std::fmt::{Display, Error, Formatter};
 use std::iter::FromIterator;
@@ -548,6 +549,7 @@
 /// Parses all "ignore" files with their recursive includes and returns a
 /// function that checks whether a given file (in the general sense) should be
 /// ignored.
+#[timed]
 pub fn get_ignore_function<'a>(
     all_pattern_files: &[impl AsRef<Path>],
     root_dir: impl AsRef<Path>,