mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
layout: Aggressively try to share styles with the last few nodes seen.
This roughly implements the same cache found in Blink. 50% improvement on the rainbow page, but at the cost of reducing parallel gains down to nothing. I added a new page, `perf-rainbow-hard.html`, which disables the optimizations in both Blink and Servo.
This commit is contained in:
parent
0b894113e9
commit
d3e56fa9cc
8 changed files with 17838 additions and 103 deletions
|
@ -6,6 +6,7 @@
|
|||
/// rendered.
|
||||
|
||||
use css::matching::{ApplicableDeclarations, ApplicableDeclarationsCache, MatchMethods};
|
||||
use css::matching::{StyleSharingCandidateCache};
|
||||
use css::select::new_stylist;
|
||||
use css::node_style::StyledNode;
|
||||
use layout::construct::{FlowConstructionResult, FlowConstructor, NoConstructionResult};
|
||||
|
@ -570,11 +571,14 @@ impl LayoutTask {
|
|||
let mut applicable_declarations = ApplicableDeclarations::new();
|
||||
let mut applicable_declarations_cache =
|
||||
ApplicableDeclarationsCache::new();
|
||||
let mut style_sharing_candidate_cache =
|
||||
StyleSharingCandidateCache::new();
|
||||
node.match_and_cascade_subtree(self.stylist,
|
||||
&layout_ctx.layout_chan,
|
||||
&mut applicable_declarations,
|
||||
layout_ctx.initial_css_values.get(),
|
||||
&mut applicable_declarations_cache,
|
||||
&mut style_sharing_candidate_cache,
|
||||
None)
|
||||
}
|
||||
Some(ref mut traversal) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue