On 2/17/14 7:51 PM, Patrick Walton wrote:
Hi everyone,
I did some preliminary investigation into how much floats are likely to
impact parallelism in the wild. I wrote a quick script [1] that looks at
how many nodes could have their heights assigned in parallel and ran it
on the Alexa Top 50 in the US.
I assume that a node can be laid out in parallel unless it is "impacted
by floats". A node is said to be "impacted by floats" in a direction
(left or right) if any of the following is true:
(1) The node contains a float descendant that is part of the same block
formatting context.
(2) Any of its previous siblings could be impacted by floats, unless the
sibling has the "clear" property set and there are no siblings impacted
by floats in the direction(s) cleared.
(3) A parent in a separate block formatting context is itself impacted
by floats. (This accounts for the fact that "clear" does not clear
floats in separate block formatting contexts.)
Oh, one more thing: Servo currently does not use this algorithm,
resulting in poor parallel performance on many sites at the moment. In
particular:
1. Servo does not know that floats cannot spill out of block formatting
contexts, so the has-floated-children flag applies to more nodes than
necessary.
2. Servo does not take clearance into account when deciding how to
propagate the impacted-by-floats flag to siblings, so the
impacted-by-floats flag applies to more nodes than necessary.
This work seems to indicate that these two optimizations are very
important for achieving parallelism in the real world. Practically all
Alexa Top 50 use floats for parallelism, but they seem to constrain it.
Patrick
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo