mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Cache the results of cache entry revalidation and use the bloom filter.
This commit is contained in:
parent
d51d95d0c7
commit
1663bf6e5d
7 changed files with 100 additions and 49 deletions
|
@ -680,15 +680,13 @@ fn compute_style<E, D>(_traversal: &D,
|
|||
use matching::StyleSharingResult::*;
|
||||
|
||||
context.thread_local.statistics.elements_styled += 1;
|
||||
let shared_context = context.shared;
|
||||
let kind = data.restyle_kind();
|
||||
|
||||
// First, try the style sharing cache. If we get a match we can skip the rest
|
||||
// of the work.
|
||||
if let MatchAndCascade = kind {
|
||||
let sharing_result = unsafe {
|
||||
let cache = &mut context.thread_local.style_sharing_candidate_cache;
|
||||
element.share_style_if_possible(cache, shared_context, &mut data)
|
||||
element.share_style_if_possible(context, &mut data)
|
||||
};
|
||||
if let StyleWasShared(index) = sharing_result {
|
||||
context.thread_local.statistics.styles_shared += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue