Open Bug 604969 Opened 14 years ago Updated 2 years ago

talos a11y regression caused by bug 599113

Categories

(Core :: Layout, defect)

defect

Tracking

()

People

(Reporter: tnikkel, Unassigned)

References

Details

(Keywords: access)

Attachments

(2 files)

Attached file testcase
There was a talos regression in a11y caused by http://hg.mozilla.org/mozilla-central/rev/8188183a6402 of bug 599113. It is not a regression in a11y speed, but rather a general slowdown as it also slows down when removing the a11y aspect.

The testcase is just the page in the a11y page load test that regressed with the a11y aspect removed.

So it looks like doing the extra invalidates are taking more time. Not sure what we can do to mitigate this.
Looks like we are spending a small but significant amount of time updating the invalidate thebes region.
You could try reducing the simplification threshold from 20 to say 4?
Didn't really help. Most of the region time was in nsRegion::SubRect.

It seems like we'd almost be better off just keeping a list of rects (with some upper bound to the number of them), and then at the next paint doing something a little clever. Say if there are more than 20 rects take the bounding box, this would just be a max over the coords of the rects, without the added overhead of keeping the region invariants incrementally. Or maybe take the bounding box of the first and last rects (on the theory that the first and last rect would occupy the geometric extremes of the area), and then add in the rest somehow.
Where are the calls to nsRegion::SubRect coming from?
Just nsRegion::Or, nothing unusual is going on, it is just the non-shortcut case here http://mxr.mozilla.org/mozilla-central/source/gfx/src/nsRegion.cpp#851
I don't want to overdo this since it will go away when we move to display-list-based invalidation.

Maybe we could have a method on nsRegion that's like Or, but if the rectangle overlaps an existing rectangle, we just replace them both with the bounding-box of the pair?
I tried something simpler: if we hit the slow SubRect case just make the new region the bounding rect of the old region's bounding rect and the new rect. That restored about half of the perf we lost.
> There was a talos regression in a11y caused by
> http://hg.mozilla.org/mozilla-central/rev/8188183a6402 of bug 599113. 

The performance degradation was observed in flash video playback with this changeset. I checked on latest Fennec build with youtube flash video and the video playback is not smooth. The playback is smooth, when the same video played without this change.
Plugins for desktop Fennec don't seem to be working for me at all so I can't investigate that.

I would want to look at nsHTMLScrollFrame/nsXULScrollFrame::InvalidateInternal and the rect to invalidate and the scrollport to see why we are invalidating outside the scrollport.
I got it working with vimeo and the pref plugin.disable flipped. (At least I think vimeo was serving me flash, I don't know how to tell flash from say a video tag in fennec.)

I set breakpoints on the new code that changeset 8188183a6402 added and they were never hit.
You could try this patch to see if it speeds it up for you.
(In reply to comment #11)
> Created attachment 486197 [details] [diff] [review]
> quicker less accurate region stuff
> 
> You could try this patch to see if it speeds it up for you.

I’ve not seen any performance improvement in flash video case with this patch.
Can you profile? Where is the extra time being taken?

Can you debug? Are we hitting the seperateThebes case in nsHTMLScrollFrame::InvalidateInternal or nsXULScrollFrame::InvalidateInternal?
(In reply to comment #13)
> Can you profile? Where is the extra time being taken?
> 
> Can you debug? Are we hitting the seperateThebes case in
> nsHTMLScrollFrame::InvalidateInternal or nsXULScrollFrame::InvalidateInternal?

I've not done profiling on this. But, I quickly checked by adding logs and found that we are spending extra time by calling InvalidateThebesLayerContents as 
seperateThebes is always true in sHTMLScrollFrame::InvalidateInternal while playing the flash video.
Thanks for investigating.

Can you reproduce the problem on a flash video page other than youtube, on a page that works with Fennec-on-the-desktop? Youtube doesn't seem to be working on Fennec-on-the-desktop right now, so I had to test vimeo. (You need to flip the pref plugin.disable to plugins to work at all on Fennec-on-the-desktop.)
Spun off the Fennec youtube issue into bug 608930.
Keywords: access
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: