RESOLVED FIXED 100358
[V8] Add histograms to measure V8 work done during window close and navigation
https://bugs.webkit.org/show_bug.cgi?id=100358
Summary [V8] Add histograms to measure V8 work done during window close and navigation
Ulan Degenbaev
Reported 2012-10-25 02:24:43 PDT
We need to track V8DOMWindowShell::clearForNavigation time to be able to quickly detect such performance issues as http://code.google.com/p/chromium/issues/detail?id=155270
Attachments
Patch (3.25 KB, patch)
2012-10-25 10:32 PDT, Ojan Vafai
no flags
Patch (2.40 KB, patch)
2012-10-25 12:36 PDT, Ojan Vafai
abarth: review+
abarth: commit-queue-
Ojan Vafai
Comment 1 2012-10-25 09:09:32 PDT
Looking at the callers, I wonder if we actually want to instrument ScriptController::clearForNavigation. That seems to cover more of the code that we call pre navigating. I don't know this code at all though.
Ojan Vafai
Comment 2 2012-10-25 09:15:13 PDT
Digging a bit further, it looks like V8DOMWindowShell::clearForNavigation is only ever called by ScriptController::clearForNavigation, which is only ever called by ScriptController::clearWindowShell. Can we kill ScriptController::clearForNavigation?
Ojan Vafai
Comment 3 2012-10-25 09:19:14 PDT
Oh, I see. There's also a clearForClose. I suppose it's better self-documenting code?
Ojan Vafai
Comment 4 2012-10-25 10:32:13 PDT
Adam Barth
Comment 5 2012-10-25 10:52:56 PDT
Comment on attachment 170685 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=170685&action=review > Source/WebCore/bindings/v8/ScriptController.cpp:119 > + WebKit::Platform::current()->histogramCustomCounts("ScriptController::~ScriptController", (currentTime() - start) * 1000, 0, 10000, 50); We have helper functions in HistogramSupport.h so that other ports can add their histogram backends if they desire.
Adam Barth
Comment 6 2012-10-25 10:54:29 PDT
Comment on attachment 170685 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=170685&action=review > Source/WebCore/bindings/v8/ScriptController.cpp:162 > + WebKit::Platform::current()->histogramCustomCounts("ScriptController::reset", (currentTime() - start) * 1000, 0, 10000, 50); Is reset called from places other than clearForClose and clearWindowShell? It's a bit strange that you'll have several of these timers running at once. For example, in ~ScriptController, it looks like you'll have three running.
Ojan Vafai
Comment 7 2012-10-25 10:59:45 PDT
Comment on attachment 170685 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=170685&action=review >> Source/WebCore/bindings/v8/ScriptController.cpp:119 >> + WebKit::Platform::current()->histogramCustomCounts("ScriptController::~ScriptController", (currentTime() - start) * 1000, 0, 10000, 50); > > We have helper functions in HistogramSupport.h so that other ports can add their histogram backends if they desire. Oh right. I'm a bit braindead this morning clearly. >> Source/WebCore/bindings/v8/ScriptController.cpp:162 >> + WebKit::Platform::current()->histogramCustomCounts("ScriptController::reset", (currentTime() - start) * 1000, 0, 10000, 50); > > Is reset called from places other than clearForClose and clearWindowShell? It's a bit strange that you'll have several of these timers running at once. For example, in ~ScriptController, it looks like you'll have three running. It's true. I could drop the reset one for now as it is a little redundant. Should I drop ~ScriptController too? The only extra thing that really measures is windowShell()->destroyGlobal().
Ojan Vafai
Comment 8 2012-10-25 11:04:45 PDT
(In reply to comment #7) > (From update of attachment 170685 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=170685&action=review > > >> Source/WebCore/bindings/v8/ScriptController.cpp:162 > >> + WebKit::Platform::current()->histogramCustomCounts("ScriptController::reset", (currentTime() - start) * 1000, 0, 10000, 50); > > > > Is reset called from places other than clearForClose and clearWindowShell? It's a bit strange that you'll have several of these timers running at once. For example, in ~ScriptController, it looks like you'll have three running. > > It's true. I could drop the reset one for now as it is a little redundant. Should I drop ~ScriptController too? The only extra thing that really measures is windowShell()->destroyGlobal(). Now that I look, destroyGlobal literally just clears m_global. I'll remove this histogram too.
Ojan Vafai
Comment 9 2012-10-25 12:36:08 PDT
Adam Barth
Comment 10 2012-10-25 12:37:36 PDT
Comment on attachment 170713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=170713&action=review > Source/WebCore/bindings/v8/ScriptController.cpp:162 > + HistogramSupport::histogramCustomCounts("ScriptController::clearForClose", (currentTime() - start) * 1000, 0, 10000, 50); We usually use names more like WebCore.ScriptController.ClearForClose for histograms.
Ojan Vafai
Comment 11 2012-10-25 12:58:10 PDT
Note You need to log in before you can comment on or make changes to this bug.