Bug 100358 - [V8] Add histograms to measure V8 work done during window close and navigation
Summary: [V8] Add histograms to measure V8 work done during window close and navigation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ulan Degenbaev
URL:
Keywords:
Depends on: 100390
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-25 02:24 PDT by Ulan Degenbaev
Modified: 2012-10-25 15:15 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.25 KB, patch)
2012-10-25 10:32 PDT, Ojan Vafai
no flags Details | Formatted Diff | Diff
Patch (2.40 KB, patch)
2012-10-25 12:36 PDT, Ojan Vafai
abarth: review+
abarth: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulan Degenbaev 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
Comment 1 Ojan Vafai 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.
Comment 2 Ojan Vafai 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?
Comment 3 Ojan Vafai 2012-10-25 09:19:14 PDT
Oh, I see. There's also a clearForClose. I suppose it's better self-documenting code?
Comment 4 Ojan Vafai 2012-10-25 10:32:13 PDT
Created attachment 170685 [details]
Patch
Comment 5 Adam Barth 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.
Comment 6 Adam Barth 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.
Comment 7 Ojan Vafai 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().
Comment 8 Ojan Vafai 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.
Comment 9 Ojan Vafai 2012-10-25 12:36:08 PDT
Created attachment 170713 [details]
Patch
Comment 10 Adam Barth 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.
Comment 11 Ojan Vafai 2012-10-25 12:58:10 PDT
Committed r132517: <http://trac.webkit.org/changeset/132517>