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.)
I believe these rules are sufficient to capture the idea of a node that
can be laid out in parallel with its siblings, although I could
definitely be wrong here. Take these numbers with a grain of salt,
because it's very possible I'm missing something in the algorithm.
Anyway, the results are in this Google Doc [2]. In summary: On average
85.16% of nodes can be laid out in parallel. There is some variability:
two of the sites (reddit.com and buzzfeed.com) were below 60% parallel.
However, the numbers seemed overall promising: 73% of the sites had >
80% of the nodes able to be laid out in parallel.
Patrick
[1]: https://gist.github.com/pcwalton/9064215
[2]:
https://docs.google.com/spreadsheet/ccc?key=0AmYOd6rv-l1OdHA0bVVRd3I4OW1xTEV1SERYUldrU2c&usp=sharing
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo