Peter Weilbacher wrote:
> I found out that it likely some kind of timer problem,
> we seem to be repainting much more often than we should be (and call
> into _PR_MD_GET_INTERVAL() even more). If I switch to the low-resolution
> timer (high-res is the default) that only gives us granularity of 1ms,
> long pages loads 4 to 6 times faster, with a similar reduction in the
> number of painting calls.
Out of curiousity, do the hi-res and low-res timers give the same
answers (up to the low-res granularity)? How long does a call into the
hi-res timer take?
> So, I basically want to know why the timer resolution directly influences
> the number of repaints.
That's a really good question!
> Now, loading the page takes about 3min to load with the high-res timer,
> so it should repaint about a maximum of 1500 times (180s/120000us)
120000us is the notification interval if the user is not interacting
with the browser (no mouse movement or keyboard movement). If there is
interaction the notification interval is 1000us. We check every 750ms
to see whether to switch notification modes.
> with the default settings, as repaints should not occur more often than
> content.notify.interval.
That's the theory, but in practice there is a known failure mode here
that goes like this:
1) Content notification fires. Reflow event is scheduled.
2) Reflow event fires as soon as it can. Content model is flushed,
reflow and painting happen, we return to the event loop.
3) We reenter the parser. The next time we close a tag, if we had
already parsed some of its kids before step 2 above, we do an
immediate notification.
So I think in practice, and esp. for long pages, we notify pretty much
continuously, and the factor determining how often paints happen is more
or less how often we break out of the parser into the main event loop.
Compositor should help with all that.
> But I'm seeing more than 7000 repaints (looking
> at call numbers of nsWindow::OnPaint).
How many calls into nsPresShell::ContentAppended/ContentInserted are you
seeing?
> Also, I see that the above backoffcount setting stops the repaints
> before the page is loaded completely.
What it does is stop the sink-timer-triggered notifications. It doesn't
stop notifications like in step 3 above.
-Boris
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout