Limit traversal statistics dumps to subtrees of 50 or more elements.

On Gecko, we get tons of console spam from 1-element traversals if we
don't do this.
This commit is contained in:
Bobby Holley 2017-04-12 17:36:38 +08:00
parent 31ea4208cf
commit 591733408d
3 changed files with 12 additions and 2 deletions

View file

@ -223,6 +223,12 @@ impl TraversalStatistics {
self.is_parallel = Some(traversal.is_parallel());
self.traversal_time_ms = (time::precise_time_s() - start) * 1000.0;
}
/// Returns whether this traversal is 'large' in order to avoid console spam
/// from lots of tiny traversals.
pub fn is_large_traversal(&self) -> bool {
self.elements_traversed >= 50
}
}
#[cfg(feature = "gecko")]