Bug 145066

Summary: Web Inspector: Reduce type annotation update frequency
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, saam, timothy, webkit-bug-importer
Priority: P2 Keywords: DoNotImportToRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
timothy: review+
[PATCH] For Landing none

Description Joseph Pecoraro 2015-05-15 12:27:50 PDT
* SUMMARY
Reduce type annotation update frequency.

I was seeing Runtime.getRuntimeTypesForVariablesAtOffsets happening every 16-24ms in the case where nothing is changing. That is unnecessarily frequent. Lets reduction this to 100ms - 2000ms (worst case).
Comment 1 Joseph Pecoraro 2015-05-15 12:28:57 PDT
Created attachment 253215 [details]
[PATCH] Proposed Fix
Comment 2 Saam Barati 2015-05-15 12:46:57 PDT
Comment on attachment 253215 [details]
[PATCH] Proposed Fix

Looks good to me. 
At some point I work on the patch that makes it so we only
update when we need to. This would have the consequence
of never updating when code stops running which would be
a big win.
Comment 3 Saam Barati 2015-05-15 12:49:30 PDT
(In reply to comment #0)
> * SUMMARY
> Reduce type annotation update frequency.
> 
> I was seeing Runtime.getRuntimeTypesForVariablesAtOffsets happening every
> 16-24ms in the case where nothing is changing. That is unnecessarily
> frequent. Lets reduction this to 100ms - 2000ms (worst case).

It looks like the code has the maximum at 1000, not sure if you want
to make it 2000 or keep it at 1000
Comment 4 Timothy Hatcher 2015-05-15 13:00:31 PDT
Comment on attachment 253215 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js:71
> +            var timeoutTime = Math.max(100, Math.min(1000, 8 * totalTime));

ChangeLog says 2000, code says 1000.
Comment 5 Joseph Pecoraro 2015-05-15 13:27:45 PDT
(In reply to comment #4)
> Comment on attachment 253215 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253215&action=review
> 
> > Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js:71
> > +            var timeoutTime = Math.max(100, Math.min(1000, 8 * totalTime));
> 
> ChangeLog says 2000, code says 1000.

Oops. I'll make it 2000. At one point I did see a 1.2s being possible.
Comment 6 Joseph Pecoraro 2015-05-15 13:37:59 PDT
Created attachment 253220 [details]
[PATCH] For Landing
Comment 7 WebKit Commit Bot 2015-05-15 14:37:32 PDT
Comment on attachment 253220 [details]
[PATCH] For Landing

Clearing flags on attachment: 253220

Committed r184418: <http://trac.webkit.org/changeset/184418>