RESOLVED FIXED 14742
Document::recalcStyle(Force) called for every updateStyleIgnorePendingStylesheets while waiting for stylesheets
https://bugs.webkit.org/show_bug.cgi?id=14742
Summary Document::recalcStyle(Force) called for every updateStyleIgnorePendingStylesh...
mitz
Reported 2007-07-23 23:28:31 PDT
If stylesheets have not yet loaded, updateStyleIgnorePendingStylesheets() will call updateStyleSelector() which calls recalcStyle(Force). This is *not* a regression from the m_didCalculateStyleSelector patch (which fixed a Yahoo! Mail crash), but still would be nice to fix at some point. Basically you need updateStyleSelector() to only set a flag and postpone the update until later when you need it.
Attachments
Patch (not for now) (2.82 KB, patch)
2007-07-23 23:30 PDT, mitz
no flags
Patch (for now) (2.14 KB, patch)
2007-08-03 08:07 PDT, mitz
hyatt: review+
mitz
Comment 1 2007-07-23 23:30:58 PDT
Created attachment 15656 [details] Patch (not for now)
mitz
Comment 2 2007-08-01 00:26:53 PDT
See also bug 14839.
David Kilzer (:ddkilzer)
Comment 3 2007-08-01 06:56:07 PDT
*** Bug 14839 has been marked as a duplicate of this bug. ***
David Kilzer (:ddkilzer)
Comment 4 2007-08-01 06:56:49 PDT
mitz
Comment 5 2007-08-01 11:32:05 PDT
(In reply to comment #3) > *** Bug 14839 has been marked as a duplicate of this bug. *** Raising priority to P2 since the bug affects a popular website. Dave, could you check if this is a regression from the Safari/WebKit that shipped with Tiger?
David Kilzer (:ddkilzer)
Comment 6 2007-08-01 15:10:43 PDT
(In reply to comment #5) > Raising priority to P2 since the bug affects a popular website. Dave, could you > check if this is a regression from the Safari/WebKit that shipped with Tiger? It is a slight regression for the Safari 3 Public Beta v. 3.0.3 on Tiger: Using a 1.5 GHz PowerBook G4: Using Mac OS X 10.4.10 (8R218) Tiger: - Safari 2.0.4 (419.3) with its original WebKit: ~8 seconds - Safari 3 Public Beta 3.0.3 (522.12.1) with its original WebKit: ~10 seconds However, Safari on Leopard is slightly better than Safari 2.0.4 on Tiger.
David Kilzer (:ddkilzer)
Comment 7 2007-08-02 06:44:51 PDT
On the same hardware on Mac OS X 10.4.10 (8R218) using Safari 3 Public Beta v. 3.0.3 (522.12.1) with a DEBUG BUILD of ToT Webkit r24803, the page loads in ~2 seconds. Testing methodology: 1. Launch Safari/WebKit. 2. Open the page once (untimed). 3. Hit Cmd-R and time the load. 4. Repeat Step 3 five or six times to get a ballpark figure.
mitz
Comment 8 2007-08-03 08:00:51 PDT
(In reply to comment #7) > On the same hardware on Mac OS X 10.4.10 (8R218) using Safari 3 Public Beta v. > 3.0.3 (522.12.1) with a DEBUG BUILD of ToT Webkit r24803, the page loads in ~2 > seconds. Just to make sure I understood, a debug build of r24803 is almost 5 times faster than the beta?
mitz
Comment 9 2007-08-03 08:07:05 PDT
Created attachment 15818 [details] Patch (for now) This is a very pinpointed and conservative fix. I think in the long run, Document::updateStyleSelector() should be replaced with a function that just sets a "style selector dirty" flag, and Document::styleSelector() should lazily update the style selector as needed. That is worth doing even if JavaScript becomes interruptible, because it will coalesce style updates.
David Kilzer (:ddkilzer)
Comment 10 2007-08-03 08:21:07 PDT
(In reply to comment #8) > (In reply to comment #7) > > On the same hardware on Mac OS X 10.4.10 (8R218) using Safari 3 Public Beta v. > > 3.0.3 (522.12.1) with a DEBUG BUILD of ToT Webkit r24803, the page loads in ~2 > > seconds. > > Just to make sure I understood, a debug build of r24803 is almost 5 times > faster than the beta? Correct.
Dave Hyatt
Comment 11 2007-08-07 12:58:21 PDT
Comment on attachment 15818 [details] Patch (for now) r=me
Mark Rowe (bdash)
Comment 12 2007-08-09 20:56:46 PDT
Landed in r24973.
Note You need to log in before you can comment on or make changes to this bug.