On Wednesday 2013-08-21 20:52 +0800, Thinker K.F. Li wrote:
> I am doing profiling for several Apps on b2g, and have found near 1x% ~
> 20% of CPU time when scrolling are spent on building display list.  So,
> I think we can use cache for display lists to save time of creating the
> same display items repeatedly.
> 
> I just have done some studies, and have a rough idea.  My idea is
> attaching the caches with frames.

Which items would you cache, on which frames, and for how long?

> When a frame is
> MarkIntrinsicWidthsDirty()ed, the attached cache is deleted if any.  For
> the frames that their parents are MarkIntrinsicWidthsDirty()ed for last
> reflowing, but not themself, the results of their BuildDisplayList() are
> kept in the cache.  I guess most animation will modify the same set of
> subtrees repeatedly.  So, we can save time for building display lists.

So clearing caches in MarkIntrinsicWidthsDirty isn't sufficient (at
least due to style changes that either change rendering only, or
change layout without changing intrinsic widths), and it also
doesn't seem like the right point, given the patterns in which it is
called (see PresShell::FrameNeedsReflow) and the overall
architecture (MarkIntrinsicWidthsDirty is really about intrinsic
width changes, which aren't especially related to what you care
about here, although there's a correlation).

I think I'd be more interested in solutions that are more specific
to the problem of scrolling, such as updating an existing display
list specifically for scrolling (as mattwoodrow mentioned), or
perhaps (though this is less an area where I know what's going on)
doing scrolling even further down the pipeline, using layers that
are drawn with extra area that we are scrolling towards.

-David

-- 
π„ž   L. David Baron                         http://dbaron.org/   𝄂
𝄒   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to