Hi everyone,
Conversations last evening with roc got me to thinking about
invalidation some more. Currently, Servo repaints the whole displayport
on every change. This is obviously not going to work in the long run. At
the same time, we actually benefit in some ways from not doing
invalidation -- in particular, this came up in the context of the maze
solver benchmark, where it's actually better to *not* do invalidation
during layout and offload that work to a background thread so that you
can return to script as quickly as possible (and this helps Servo's
performance significantly).
My tentative plan was basically to do simple overflow-based invalidation
on the layout thread and then to augment that with DLBI on the painting
thread (which is separate from the layout thread). By "overflow-based
invalidation" I mean that the invalid region cannot be any larger than
the union of the old and new overflow regions of all flows (frames, in
Gecko terminology) with Repaint restyle damage. We do (at least try to)
perform the hard work of computing overflow regions during layout today,
so this would be a simple matter of just using those overflow regions
for invalidation. This will provide accurate invalidation for simple
cases like "a button's background color changed", and I suspect this
will not regress performance on the maze solver given that we already
have the overflow regions for each flow.
For more complex cases, I was planning to perform display list-based
invalidation (DLBI) on the painting thread. I also do not expect this to
regress our maze solver performance because this is all on a background
thread. But DLBI is still expensive, of course, and blocks the user from
seeing the page. My question is: What are some instance of complex cases
that we often see in the wild that simple "overflow-based invalidation"
does not handle accurately enough? In other words, what are examples of
the major pain points that DLBI was designed to handle in Gecko?
My motive for asking this is twofold. First, if we can make DLBI
cheaper, or even go with a different algorithm (approximation of full
DLBI, something different entirely) that's cheap to compute and handles
the important cases, that's a win I'd like to go for. Second, when we
start implementing our invalidation logic, it'd be nice to have a set of
use cases in mind so we can test its effectiveness.
Thanks!
Patrick
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo