When doing ProcessDisplayItems(), it would be forced to collect information from frame tree, styles, and nsIContent for every items. It is wasting time to access these memory and hurts CPU cache. The idea is to keep a copy of key information on items to reduce the overhead of memory access.
Created attachment 8828714 [details] [diff] [review] getbounds.diff This patch caches the result of GetBounds() when items are wrapped by nsDisplayWrapList. This is just an experiment, not a best choice. The best choice is to cache the result when create items to get benefited by the fact that the relative data is already in CPU cache. Anyway, it shows an improvement of 5% on nsDisplayList::PaintRoot().
Created attachment 8828717 [details] [diff] [review] without-docacheforitems.diff try this patch basing on getbounds.diff. Although getbounds.diff improves |PaintRoot()|, but it increases |nsIFrame::BuildDisplayListForStackingContext()|. This patch removes doing caching in |nsDisplayWrapList|, but do it for the first time that GetBoundsCache() has been called.
Thinker, are you still working on this?
I have some bugs relating to this one. They should block this one. I will do it later.
You need to log in before you can comment on or make changes to this bug.