DevTools/Performance/JIT: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with " == Overview == When approaching the upper bounds of squeezing out performance, the more relevant the platform details become. We want to expose engine-level information on...")
 
No edit summary
Line 16: Line 16:
* Optimizing new ES.* features in Spider Monkey
* Optimizing new ES.* features in Spider Monkey
* Finding how to optimize hot areas of code (advanced usage)
* Finding how to optimize hot areas of code (advanced usage)
  Frameworks (React, Ember, PlayCanvas, jQuery, Three.js)
Frameworks (React, Ember, PlayCanvas, jQuery, Three.js)
  Environments (Shumway, J2ME.js)
Environments (Shumway, J2ME.js)
  SIMD?
SIMD?
* Ensuring functions stay at the highest level of optimization (more important than using better optimization strategies per optimization site)
* Ensuring functions stay at the highest level of optimization (more important than using better optimization strategies per optimization site)
* Guide web developers to optimize their web app with low-hanging-fruit, without needing engine knowledge
* Guide web developers to optimize their web app with low-hanging-fruit, without needing engine knowledge
Line 62: Line 62:
* [http://mrale.ph/irhydra/2/ IRHydra (V8, Dart)]
* [http://mrale.ph/irhydra/2/ IRHydra (V8, Dart)]
* [https://developer.chrome.com/devtools/docs/cpu-profiling Chrome DevTools (V8)]
* [https://developer.chrome.com/devtools/docs/cpu-profiling Chrome DevTools (V8)]
  No documentation regarding the deopt icons, and the tooltips they use are still pretty cryptic; some deopts I've seen:
No documentation regarding the deopt icons, and the tooltips they use are still pretty cryptic; some deopts I've seen:
   Reference to a variable that requires dynamic lookup
   Reference to a variable that requires dynamic lookup
   ForInStatement is not fast case
   ForInStatement is not fast case

Revision as of 00:37, 2 April 2015


Overview

When approaching the upper bounds of squeezing out performance, the more relevant the platform details become. We want to expose engine-level information on how JavaScript gets executed in Firefox in order to highlight areas of code that can be better optimized. As Spider Monkey's optimization tiers are wrapped in arcane magic and mystery, we also need a way to translate this engine data to actionable directives, able to be interpreted by performance-seeking engineers without needing to be JIT hackers.

Using this translated JIT data, we can then reference the profiler's samples to guide a user to focus on optimization for especially hot areas of code, also leveraging any "badness" weight to levels of optimizations. If we are successful in translating JIT data to actionable instructions for the advanced performance engineers, then the next step is to distill this information to be even more accessible to the average web developer, hiding most of the JIT-jargon.

There will be at least this "advanced view", behind a pref, as a subview in the Performance tool's Call Tree (or maybe its own detailed view?), and if we make actionable information accessible enough, subtle guides for all users in the profiler.

Currently, in Fx40, the JIT Optimizations view is available in the performance tool behind `devtools.performance.ui.show-jit-optimizations` for displaying the JIT optimization attempts per site as an initial prototype.

Users/Use Cases

  • Help in debugging the JIT itself for Ion Monkey engineers
  • Optimizing new ES.* features in Spider Monkey
  • Finding how to optimize hot areas of code (advanced usage)

Frameworks (React, Ember, PlayCanvas, jQuery, Three.js) Environments (Shumway, J2ME.js) SIMD?

  • Ensuring functions stay at the highest level of optimization (more important than using better optimization strategies per optimization site)
  • Guide web developers to optimize their web app with low-hanging-fruit, without needing engine knowledge

Requirements/Steps

Meta bug

Gather Information

gather common deoptimization patterns, see if there are any possible (djvj, shu)

Expose Documentation

docs With the raw JIT opt data view in Fx40, translate the optimization attempts, outcomes, Ion types, with better descriptions. Not necessarily actionable, but some insight.

Expose Advanced Information

JIT Coach

  • Actionable suggestions for the average web developer with no JIT knowledge

UI/UX

Timeline/Milestones

  • Requirements: Mid Q2
  • Ship: Mid Q3

Evaluation Metrics

Prior Art

No documentation regarding the deopt icons, and the tooltips they use are still pretty cryptic; some deopts I've seen:

 Reference to a variable that requires dynamic lookup
 ForInStatement is not fast case
 Context-allocated arguments
 TryCatchStatement
 Optimized too many times
 Assignment to parameter in arguments object
 Bad value context for arguments value