Struct style::context::TraversalStatistics
[−]
[src]
pub struct TraversalStatistics { pub elements_traversed: u32, pub elements_styled: u32, pub elements_matched: u32, pub styles_shared: u32, pub styles_reused: u32, pub selectors: u32, pub revalidation_selectors: u32, pub dependency_selectors: u32, pub declarations: u32, pub stylist_rebuilds: u32, pub traversal_time_ms: f64, pub is_parallel: Option<bool>, pub is_large: Option<bool>, }
Statistics gathered during the traversal. We gather statistics on each thread and then combine them after the threads join via the Add implementation below.
Fields
elements_traversed: u32
The total number of elements traversed.
elements_styled: u32
The number of elements where has_styles() went from false to true.
elements_matched: u32
The number of elements for which we performed selector matching.
The number of cache hits from the StyleSharingCache.
styles_reused: u32
The number of styles reused via rule node comparison from the StyleSharingCache.
selectors: u32
The number of selectors in the stylist.
revalidation_selectors: u32
The number of revalidation selectors.
dependency_selectors: u32
The number of state/attr dependencies in the dependency set.
declarations: u32
The number of declarations in the stylist.
stylist_rebuilds: u32
The number of times the stylist was rebuilt.
traversal_time_ms: f64
Time spent in the traversal, in milliseconds.
is_parallel: Option<bool>
Whether this was a parallel traversal.
is_large: Option<bool>
Whether this is a "large" traversal.
Methods
impl TraversalStatistics
[src]
pub fn finish<E, D>(&mut self, traversal: &D, parallel: bool, start: f64) where
E: TElement,
D: DomTraversal<E>,
[src]
E: TElement,
D: DomTraversal<E>,
Computes the traversal time given the start time in seconds.
pub fn is_large_traversal(&self) -> bool
[src]
Returns whether this traversal is 'large' in order to avoid console spam from lots of tiny traversals.
Trait Implementations
impl Default for TraversalStatistics
[src]
fn default() -> TraversalStatistics
[src]
Returns the "default value" for a type. Read more
impl<'a> Add for &'a TraversalStatistics
[src]
Implementation of Add to aggregate statistics across different threads.
type Output = TraversalStatistics
The resulting type after applying the +
operator.
fn add(self, other: Self) -> TraversalStatistics
[src]
Performs the +
operation.
impl Display for TraversalStatistics
[src]
Format the statistics in a way that the performance test harness understands. See https://bugzilla.mozilla.org/show_bug.cgi?id=1331856#c2