WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
99830
Web Inspector: Show aggregated time between corresponding time/timeEnd records.
https://bugs.webkit.org/show_bug.cgi?id=99830
Summary
Web Inspector: Show aggregated time between corresponding time/timeEnd records.
eustas.bug
Reported
2012-10-19 04:50:53 PDT
console.time / console.timeEnd are used to measure how long some process takes. This patch makes this feature more useful - not aggregated statistics is shown for measured interval.
Attachments
Patch
(16.08 KB, patch)
2012-10-19 06:50 PDT
,
eustas.bug
no flags
Details
Formatted Diff
Diff
Patch
(15.91 KB, patch)
2012-10-22 01:02 PDT
,
eustas.bug
no flags
Details
Formatted Diff
Diff
Popup with aggregated statistics.
(74.12 KB, image/png)
2012-10-22 01:41 PDT
,
eustas.bug
no flags
Details
Patch
(21.01 KB, patch)
2012-10-22 03:09 PDT
,
eustas.bug
no flags
Details
Formatted Diff
Diff
Patch
(21.06 KB, patch)
2012-10-23 07:40 PDT
,
eustas.bug
no flags
Details
Formatted Diff
Diff
Patch
(21.26 KB, patch)
2012-10-30 05:50 PDT
,
eustas.bug
pfeldman
: review-
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
eustas.bug
Comment 1
2012-10-19 06:50:31 PDT
Created
attachment 169613
[details]
Patch
eustas.bug
Comment 2
2012-10-22 01:02:11 PDT
Created
attachment 169844
[details]
Patch
Pavel Feldman
Comment 3
2012-10-22 01:23:44 PDT
Comment on
attachment 169844
[details]
Patch Could you elaborate on "aggregated statistics" and add a test?
eustas.bug
Comment 4
2012-10-22 01:41:42 PDT
Created
attachment 169851
[details]
Popup with aggregated statistics.
eustas.bug
Comment 5
2012-10-22 03:08:31 PDT
(In reply to
comment #3
)
> (From update of
attachment 169844
[details]
) > Could you elaborate on "aggregated statistics" and add a test?
Done.
eustas.bug
Comment 6
2012-10-22 03:09:23 PDT
Created
attachment 169865
[details]
Patch
Andrey Kosyakov
Comment 7
2012-10-23 07:16:25 PDT
Comment on
attachment 169865
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=169865&action=review
> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:622 > + var record = this; > + var parent = record.parent; > + while (parent.parent) { > + record = parent; > + parent = parent.parent; > + } > + return record;
for (var record = this; record.parent && record.parent.parent; record = record.parent) {}
> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1026 > + while (record.type !== WebInspector.TimelineModel.RecordType.Root) {
ditto, use for(;;)
> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1033 > + if (child.endTime >= boundryTime) > + continue;
why not break?
eustas.bug
Comment 8
2012-10-23 07:33:03 PDT
Comment on
attachment 169865
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=169865&action=review
>> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:622 >> + return record; > > for (var record = this; record.parent && record.parent.parent; record = record.parent) {}
Done
>> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1026 >> + while (record.type !== WebInspector.TimelineModel.RecordType.Root) { > > ditto, use for(;;)
Done
>> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1033 >> + continue; > > why not break?
because glued records may appear out of order.
eustas.bug
Comment 9
2012-10-23 07:40:07 PDT
Created
attachment 170163
[details]
Patch
Andrey Kosyakov
Comment 10
2012-10-23 08:40:07 PDT
LGTM
Pavel Feldman
Comment 11
2012-10-30 04:54:10 PDT
Comment on
attachment 170163
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=170163&action=review
> Source/WebCore/inspector/front-end/TimelinePanel.js:556 > + this._innerAddRecordToTimeline(records[i]);
Is this change related?
> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:615 > + get topLevelRecord()
Please use methods (isTopLevelRecord) instead of getters for better compile-ability. Also, this seems to be slow, you might want to reflect it in the name.
> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:775 > contentHelper._appendTextRow(WebInspector.UIString("Self Time"), Number.secondsToString(this._selfTime, true));
Why is time excluded? Does this belong to this change?
> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1014 > +WebInspector.TimelinePresentationModel._calculateAggregatedStatsBetweenRecords = function(head, tail)
I thought we already aggregated the time for the CPU summary. Why do we need separate code for that?
eustas.bug
Comment 12
2012-10-30 05:14:32 PDT
Comment on
attachment 170163
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=170163&action=review
>> Source/WebCore/inspector/front-end/TimelinePanel.js:556 >> + this._innerAddRecordToTimeline(records[i]); > > Is this change related?
No. This change is unrelated. I've done this change to make clarify - "what is parentRecord parameter of _innerAddRecord method".
>> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:615 >> + get topLevelRecord() > > Please use methods (isTopLevelRecord) instead of getters for better compile-ability. Also, this seems to be slow, you might want to reflect it in the name.
OK
>> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:775 >> contentHelper._appendTextRow(WebInspector.UIString("Self Time"), Number.secondsToString(this._selfTime, true)); > > Why is time excluded? Does this belong to this change?
"Time" is excluded to avoid doubling "Aggregated Time" field. Aggregated time for "Time/TimeEnd" records is not computed "online", so it can't be rendered at this line.
>> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1014 >> +WebInspector.TimelinePresentationModel._calculateAggregatedStatsBetweenRecords = function(head, tail) > > I thought we already aggregated the time for the CPU summary. Why do we need separate code for that?
We need to aggregate time by categories between two specified moments. The problem is - we can't simply use already calculated aggregated time, because cutting record in the middle changes its "self" time. We do reuse already calculated aggregated time for all records except records on the "cut".
eustas.bug
Comment 13
2012-10-30 05:50:05 PDT
Created
attachment 171429
[details]
Patch
Pavel Feldman
Comment 14
2012-10-30 05:59:41 PDT
Comment on
attachment 171429
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=171429&action=review
> Source/WebCore/inspector/front-end/TimelinePanel.js:556 > + this._innerAddRecordToTimeline(records[i]);
Please extract this into a separate change.
> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1025 > +WebInspector.TimelinePresentationModel._calculateAggregatedStatsBetweenRecords = function(head, tail)
I still don't understand why this code is different from computing cpu time. They should be combined.
Pavel Feldman
Comment 15
2012-10-30 07:16:09 PDT
Comment on
attachment 171429
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=171429&action=review
>> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1025 >> +WebInspector.TimelinePresentationModel._calculateAggregatedStatsBetweenRecords = function(head, tail) > > I still don't understand why this code is different from computing cpu time. They should be combined.
I looked at it again, and the code is still too hard to follow. I don't think the feature is worth the complexity. So I stay by my r-.
Brian Burg
Comment 16
2014-12-12 13:41:02 PST
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests. Please file a new bug (
https://www.webkit.org/new-inspector-bug
) if the bug/feature/issue is still relevant to WebKit trunk.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug