Bug 158162

Summary: Web Inspector: Timelines: "-0.000ms" in Self Time
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed Fix none

Description Nikita Vasilyev 2016-05-27 13:09:11 PDT
Via https://bugs.webkit.org/show_bug.cgi?id=158117#c8

We should never show "-0.000ms".
It should be "0ms".
Comment 1 Radar WebKit Bug Importer 2016-05-27 13:10:13 PDT
<rdar://problem/26523350>
Comment 2 BJ Burg 2016-05-29 09:14:11 PDT
Do we have steps to reproduce this? A reduction?
Comment 3 BJ Burg 2016-05-30 13:39:52 PDT
I found several of these frames when profiling http://discuss.emberjs.com/.

STEPS TO REPRODUCE

1. Start timeline recording on the page
2. Reload the page
3. Go to "Events" view in JavaScript timeline view
4. Expand the subtree for the DOMContentLoaded event

Several of the nodes seem to have -0.000 or -0.00001 self time.
Comment 4 BJ Burg 2016-05-30 14:05:40 PDT
Created attachment 280111 [details]
Proposed Fix
Comment 5 Darin Adler 2016-05-30 16:48:18 PDT
Comment on attachment 280111 [details]
Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=280111&action=review

> Source/WebInspectorUI/UserInterface/Models/ProfileNode.js:164
> +                if (this._selfTime < 0.0001)
> +                    this._selfTime = 0.0;

This is OK, but what about normal rounding to a certain number of decimal places? Once we start doing that we might not need this any more.
Comment 6 Darin Adler 2016-05-30 20:03:30 PDT
Comment on attachment 280111 [details]
Proposed Fix

I’m going to say review+ even though I would prefer code that rounds instead of code that adds a special case just for close-to-zero and negative.
Comment 7 WebKit Commit Bot 2016-05-30 20:24:24 PDT
Comment on attachment 280111 [details]
Proposed Fix

Clearing flags on attachment: 280111

Committed r201503: <http://trac.webkit.org/changeset/201503>
Comment 8 WebKit Commit Bot 2016-05-30 20:24:28 PDT
All reviewed patches have been landed.  Closing bug.