RESOLVED FIXED 18466
webkit's performance inferior to Firefox/Opera on Opera dhtml benchmark
https://bugs.webkit.org/show_bug.cgi?id=18466
Summary webkit's performance inferior to Firefox/Opera on Opera dhtml benchmark
Michael Zedler
Reported 2008-04-13 14:00:59 PDT
Above URL contains two painting performance tests, with Webkit performing worse compared to Firefox/Opera. Problem mentioned to Catfish_Man on irc. His profiling resulted in "woah, ~25% in CGSUnionRegionWithRect", "paying a heavy cost in [NSView setNeedsDisplayInRect:] both from CGSUnionRegionWithRect and ObjC overhead" He considers this worth a bug report, so here it is.
Attachments
Experimental patch that tries unioning to avoid complex regions. (3.35 KB, patch)
2008-04-13 18:18 PDT, Dave Hyatt
no flags
David Smith
Comment 1 2008-04-13 14:04:21 PDT
Created attachment 20504
David Smith
Comment 2 2008-04-13 14:09:54 PDT
http://dscoder.com/bench2.mshark is the second one; it's 19kB too large to attach to bugzilla :( Anyway, my guess is that it's hitting some bad case of dirty rect coalescing.
Dave Hyatt
Comment 3 2008-04-13 14:33:21 PDT
These both performed really well for me, but I did not compare them to FFX and Opera.
Dave Hyatt
Comment 4 2008-04-13 14:36:24 PDT
Yeah FFX does better. This is probably all about how you coalesce dirty rects. The problem is what may work well on one test will work poorly on another. Many small moving objects will have a bias towards union, whereas a small number of faraway objects will have a bias toward separation.
Dave Hyatt
Comment 5 2008-04-13 14:38:48 PDT
We should be unioning though so I'm surprised by our inferior performance.
Dave Hyatt
Comment 6 2008-04-13 14:57:56 PDT
We're unioning so I don't think this is coalescing. I'm not sure what is going on.
Dave Hyatt
Comment 7 2008-04-13 15:29:12 PDT
Appears to be an issues with regions on OS X. The more rects you add to a region (setNeedsDisplayInRect), the slower that method gets. It's O(n^2). We may need to do unioning ourselves when many little objects are moving together on-screen and then just send the unioned rect to setNeedsDisplayInRect.
Michael Zedler
Comment 8 2008-04-13 16:21:05 PDT
I found this post on the opera blog: AMD Opteron 185 / Socket 939 / 7900GT / 2GB (No VM) FPS/# Opera 9.50 Beta Build 9841 30/140 24/165 Opera 9.50 Beta Build 9864 60/250 41/400 34/500 30/600 25/700 24/740 21/810
Michael Zedler
Comment 9 2008-04-13 16:30:33 PDT
Michael Zedler
Comment 10 2008-04-13 16:37:29 PDT
Dave Hyatt
Comment 11 2008-04-13 18:18:32 PDT
Created attachment 20509 [details] Experimental patch that tries unioning to avoid complex regions.
Dave Hyatt
Comment 12 2008-04-13 23:26:00 PDT
Fixed in r31858.
Note You need to log in before you can comment on or make changes to this bug.