RESOLVED FIXED 81200
[V8] V8GCForContextDispose should indicate whether a context is disposed for the main frame or not
https://bugs.webkit.org/show_bug.cgi?id=81200
Summary [V8] V8GCForContextDispose should indicate whether a context is disposed for ...
Ulan Degenbaev
Reported 2012-03-15 02:17:34 PDT
At the moment V8GCForContextDispose is sending idle notifications for each context disposal. If a website creates and destroys a lot of iframes, then this causes a lot of GC in V8 and degrades performance. V8 could make better GC decisions on idle notification if V8GCForContextDispose would provide a hint.
Attachments
patch (4.02 KB, patch)
2012-03-16 06:31 PDT, Ulan Degenbaev
no flags
Rebase and add a check for m_frame->page() (4.04 KB, patch)
2012-03-21 05:25 PDT, Ulan Degenbaev
japhet: review+
Rename constants. (4.06 KB, patch)
2012-03-21 09:08 PDT, Ulan Degenbaev
webkit.review.bot: commit-queue-
fix compile error (4.04 KB, patch)
2012-03-21 09:37 PDT, Ulan Degenbaev
no flags
Rename constants. (4.00 KB, patch)
2012-03-21 10:09 PDT, Ulan Degenbaev
abarth: review+
abarth: commit-queue-
rename m_contextDisposedForMainFrame and fix comma placement (3.99 KB, patch)
2012-03-21 10:25 PDT, Ulan Degenbaev
no flags
Ulan Degenbaev
Comment 1 2012-03-16 06:31:20 PDT
Created attachment 132269 [details] patch This depends on this V8 CL https://chromiumcodereview.appspot.com/9701093/ and should be landed after V8 with the CL rolls into Chromium.
mstarzinger
Comment 2 2012-03-21 01:54:18 PDT
Change looks good to me.
Ulan Degenbaev
Comment 3 2012-03-21 03:17:02 PDT
We are rolling the CL that this patch depends on to Chromium: https://chromiumcodereview.appspot.com/9701093/
Ulan Degenbaev
Comment 4 2012-03-21 05:25:54 PDT
Created attachment 133020 [details] Rebase and add a check for m_frame->page()
Ulan Degenbaev
Comment 5 2012-03-21 08:56:01 PDT
The corresponding V8 CL is in Chromium and is sticking: http://src.chromium.org/viewvc/chrome?view=rev&revision=127940 So this patch can now be committed. Adam, Kentaro, Nate: could someone of you review and commit the patch? Michael from the V8 team reviewed the part where we call V8::IdleNotification().
Nate Chapin
Comment 6 2012-03-21 09:01:48 PDT
Comment on attachment 133020 [details] Rebase and add a check for m_frame->page() View in context: https://bugs.webkit.org/attachment.cgi?id=133020&action=review LGTM with a style nit. > Source/WebCore/bindings/v8/V8GCForContextDispose.cpp:72 > + const int kLongIdlePauseInMs = 1000; > + const int kShortIdlePauseInMs = 10; We don't typically prefix constants with k. So just longIdlePauseInMS and shortIdlePauseInMs.
Ulan Degenbaev
Comment 7 2012-03-21 09:08:11 PDT
Created attachment 133053 [details] Rename constants.
WebKit Review Bot
Comment 8 2012-03-21 09:13:57 PDT
Comment on attachment 133053 [details] Rename constants. Attachment 133053 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12035555
Ulan Degenbaev
Comment 9 2012-03-21 09:37:19 PDT
Created attachment 133061 [details] fix compile error
Ulan Degenbaev
Comment 10 2012-03-21 10:09:48 PDT
Created attachment 133066 [details] Rename constants.
Adam Barth
Comment 11 2012-03-21 10:14:43 PDT
Comment on attachment 133066 [details] Rename constants. View in context: https://bugs.webkit.org/attachment.cgi?id=133066&action=review > Source/WebCore/bindings/v8/V8GCForContextDispose.cpp:40 > + : m_pseudoIdleTimer(this, &V8GCForContextDispose::pseudoIdleTimerFired), > + m_contextDisposedForMainFrame(false) The comma goes on line 40, just below the : > Source/WebCore/bindings/v8/V8GCForContextDispose.cpp:46 > + m_contextDisposedForMainFrame = m_contextDisposedForMainFrame || isMainFrame; Sorry to nit-pick you names, but consider a name like m_didDisposeContextForMainFrame. This is an Objective-C style name, which we often use in WebKit because of the strong Mac influence on the project.
Ulan Degenbaev
Comment 12 2012-03-21 10:25:29 PDT
Created attachment 133070 [details] rename m_contextDisposedForMainFrame and fix comma placement Thanks for reviewing!
Adam Barth
Comment 13 2012-03-21 10:51:41 PDT
Comment on attachment 133070 [details] rename m_contextDisposedForMainFrame and fix comma placement Thanks.
WebKit Review Bot
Comment 14 2012-03-21 11:54:34 PDT
Comment on attachment 133070 [details] rename m_contextDisposedForMainFrame and fix comma placement Clearing flags on attachment: 133070 Committed r111586: <http://trac.webkit.org/changeset/111586>
WebKit Review Bot
Comment 15 2012-03-21 11:54:40 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.