mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Add telemetry probe for fraction of restyles that are parallel
This commit is contained in:
parent
0fa605d243
commit
d573081fe5
3 changed files with 42 additions and 2 deletions
|
@ -267,8 +267,19 @@ fn traverse_subtree(
|
|||
None
|
||||
};
|
||||
|
||||
let is_restyle = element.get_data().is_some();
|
||||
|
||||
let traversal = RecalcStyleOnly::new(shared_style_context);
|
||||
driver::traverse_dom(&traversal, token, thread_pool);
|
||||
let used_parallel = driver::traverse_dom(&traversal, token, thread_pool);
|
||||
|
||||
if traversal_flags.contains(TraversalFlags::ParallelTraversal) &&
|
||||
!traversal_flags.contains(TraversalFlags::AnimationOnly) &&
|
||||
is_restyle && !element.is_native_anonymous() {
|
||||
// We turn off parallel traversal for background tabs; this
|
||||
// shouldn't count in telemetry. We're also focusing on restyles so
|
||||
// we ensure that it's a restyle.
|
||||
per_doc_data.record_traversal(used_parallel);
|
||||
}
|
||||
}
|
||||
|
||||
/// Traverses the subtree rooted at `root` for restyling.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue