Closed Bug 599698 Opened 14 years ago Closed 14 years ago

very slow in IE9 Speed Reading benchmark [UpdateCurrentClip issue]

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b7

People

(Reporter: vlad, Assigned: vlad)

References

(Blocks 1 open bug, )

Details

(Whiteboard: ietestdrive)

Attachments

(2 files)

Not sure what this thing's doing, but we're quite a bit slower than IE9 here.  From looking at the code, it looks like just a lot of drawImage().
Bas looked into this some, and I just did as well in xperf.

Inside 15.54/24.88 spent in Canvas 2D DrawImage, the biggest chunk is 5.56/24.88 spent in UpdateSurfaceClip.  Do we even need this any more?  If we still need it for GDI, can we not do it for d2d surfaces?

2.55/24.88 is spent inside the actual Paint() call, and then 1.42/24.88 is spent inside DoDrawImageSecurityCheck.  For the latter, I'm kind of surprised it's taking up that much; this benchmark does a lot of drawImage calls, but that's still a lot of overhead.  Then 1.08/24.88 is in SurfaceFromElement, which again seems high for an image surface.  Inside there it's actually mostly in assign_from_qi, which is a little odd.

Looking into whether we need the UpdateSurfaceClip now -- it was added in bug 346421.
In fact, if I remove the UpdateSurfaceClip, we easily hit 60 fps.
So this was added in 2007 to work around a pixman bug.  I can't reproduce the original bug with the testcase in the old bug with or without d2d, which leads me to believe that the pixman bug is fixed (it was filed upstream, and I know clipping has been reworked at least twice since then).  So I think we should just get rid of this, because 60fps is a lot more fps than 28!
Assignee: nobody → vladimir
Attachment #478621 - Flags: review?(shaver)
Comment on attachment 478621 [details] [diff] [review]
let's get rid of this

r+a+omfgloli<3u=shaver
Attachment #478621 - Flags: review?(shaver)
Attachment #478621 - Flags: review+
Attachment #478621 - Flags: approval2.0+
Actually -- today's nightly (now that I updated from a few days ago) was about as fast, also 60fps at the start.  So this isn't going to help a huge amount, but it helps.

http://hg.mozilla.org/mozilla-central/rev/2370ecfdcbb7
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
I just tried latest hourly with this patch.

My resutls:

Fx4: 
Average FPS: 40 FPS
Average Drawing time: 26 ms
Browser score: 679 seconds

IE9:
Average FPS: 60 FPS
Average Drawing time: 16 ms
Browser score: 19 seconds

Something is bad here. I have D2D,DW,layers,JM+TM ON.
Same here it's still very slow compared to Ie9 , i've 60fps before the benchmark starts then it drops to 25/30 and it seems to slowdown further with the bench running for awhile

the score is 10sec vs 68
Wait until D3D10 layers land, that will bring it up another bunch!
s: talos-r3-fed64-007
29447 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.destination-atop.html | pixel 15,15 is 0,255,255,128; expected 0,0,0,0 +/- 5
29448 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.destination-atop.html | pixel 50,25 is 0,255,255,128; expected 0,0,0,0 +/- 5
29451 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.destination-in.html | pixel 15,15 is 0,255,255,128; expected 0,0,0,0 +/- 5
29452 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.destination-in.html | pixel 50,25 is 0,255,255,128; expected 0,0,0,0 +/- 5
29455 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.source-in.html | pixel 15,15 is 0,255,255,128; expected 0,0,0,0 +/- 5
29456 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.source-in.html | pixel 50,25 is 0,255,255,128; expected 0,0,0,0 +/- 5
29459 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.source-out.html | pixel 15,15 is 0,255,255,128; expected 0,0,0,0 +/- 5
29460 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/test_2d.composite.uncovered.image.source-out.html | pixel 50,25 is 0,255,255,128; expected 0,0,0,0 +/- 5

http://hg.mozilla.org/mozilla-central/rev/49cc66b9f097
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
We can probably just #ifndef linux this if the pixman bug still exists for linux, but let's see if the rest of the tests comes back clean.
Build ID: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7pre) Gecko/20100926 Firefox/4.0b7pre

Don't know if this patch made this change, but I get 21 seconds now on the IE speed reading demo with today's build compared to 54 seconds with yesterdays (20100925) build.
Performance has definitely improved for me on the test. However I too see the slow rising of per-frame drawing times. Starting out at +/- 10 ms and slowly climbing to 20-25 during the test.
These failures occurred on every platform.
So, I suspect this is because with non-OPERATOR_OVER we now no longer blow away the path. All these failing test cases are not using operator over. A simple context->NewPath() should probably fix this I'm guessing.
Please explain the phenomena I see with this test, and many others, that when I run a test then restart Fx4 and run it again my scores are better?  

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7pre) Gecko/20100924 Firefox/4.0b7pre - Build ID: 20100926061048
(In reply to comment #12)
> Performance has definitely improved for me on the test. However I too see the
> slow rising of per-frame drawing times. Starting out at +/- 10 ms and slowly
> climbing to 20-25 during the test.

Yep, it does that in all browsers; no idea why.

(In reply to comment #14)
> So, I suspect this is because with non-OPERATOR_OVER we now no longer blow away
> the path. All these failing test cases are not using operator over. A simple
> context->NewPath() should probably fix this I'm guessing.

hmm.. we have a gfxContextPathAutoSaveRestore here that should be recovering the path.  I'll look more.

For those who are seeing worse results in Fx4, what graphics hardware are you on?  We established last night that this is hardware dependent.. I can match IE's score on my nvidia laptop, but shaver was unable to on his intel laptop.
I'm on a HD4330 with 512MB DDR2 RAM.
Actually the test problem was just revealed by this patch, instead of being caused by it.  With non-OVER the call to fill inside UpdateSurfaceClip, even with a 0-sized rectangle, was causing rendering to happen outside of the rectangle -- specifically, to clear the remainder of the clip area.  So somewhere we're not handling these operators correctly...
i'm on a 8800gt 512mb ram with drivers 260.63
In fact, the behaviour with the patch is correct, according to philip's upstream tests -- see

  http://philip.html5.org/tests/canvas/suite/tests/2d.composite.image.destination-in.html
  http://philip.html5.org/tests/canvas/suite/tests/2d.composite.image.destination-atop.html

etc.

Looks like we need to update our tests...
(no, I take that back, I was looking at the wrong tests -- but those tests pass with my patch, where they failed before)
interestingly, Chrome fails the 'uncovered' tests, but passes the others.  and in our Makefiles, we have the non-uncovered tests disabled.
Does OperatorAffectsUncoveredAreas function need to be restored? (which was removed by bug 366283). See also bug 503283.
This is the identical code path, but updates tests.  I've filed bug 600120 for the composite.uncovered.image tests which likely shouldn't have been passing in the first place.

This has been through the try server, even!
Attachment #478964 - Flags: review?(jmuizelaar)
Oh, I should mention -- this patch takes speed reading from ~20 fps -> ~45 fps on my intel GMA HD laptop; it's not a complete fix for the benchmark, but it certainly helps.
Summary: very slow in IE9 Speed Reading benchmark → very slow in IE9 Speed Reading benchmark [UpdateCurrentClip issue]
Attachment #478964 - Flags: review?(jmuizelaar) → review+
Whiteboard: ietestdrive
http://hg.mozilla.org/mozilla-central/rev/98559eb0a783

So I'm going to call this bug resolved, for the UpdateSurfaceClip call; the remaining perf issues should be covered by bug 600410.
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Perhaps b7 blocker?
This will be fixed in b7.
Target Milestone: --- → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: