SlideShare a Scribd company logo
1 of 20
Web App Performance
▪   Rowan Beentje
▪   Chris Lord
▪   Pavel Feldman
▪   Shane O’Sullivan
Top Level Topic
▪   Scrolling Lists of Complex Data


    ▪   Stress test for all rendering platforms


    ▪   Forces us to solve everything else
Goal

▪   60fps animation
Fallback Goal

▪   30fps animation
    ▪   Reliably, no stuttering
Fallback Goal

▪   30fps animation
    ▪   Reliably, no stuttering
    ▪   Often better than unreliable 60fps
What’s stopping us?
▪   Large DOM size


    ▪   When to create the DOM? Upfront? Lazily?


    ▪   Keep it small?
Page Reflows
▪   Keep DOM small === change it on the fly


▪   Pool of reusable DOM structures for different types
    ▪   E.g. with small image, large image, no image
Measuring the DOM
▪   Changing content can make size change


▪   Must know size to inform layout


▪   But….
Keep it off the UI Thread?
▪   Possible on not-web


▪   We don’t always have Workers


▪   Workers on single CPU are slow


▪   Workers can’t do DOM anyway
Keep it off the UI Thread?
▪   Do it on the server
So what works?
▪   Hide the scroll bar


▪   Measure when not busy


▪   Measure on the server
Repaints
▪   Images are unpredictable


    ▪   Load when you don’t want…


    ▪   With the wrong size….


    ▪   Have to be decoded
Dealing with Image Load
▪   Defer all image loading




▪   Use low res images




▪   Show images only when time left in an animation frame
One size fits no one
▪   Not resizing is hard


▪   Have a very strict layout


▪   Only serve the right sizes
    ▪   Helps to be a large corporation, not for everyone


▪   Get designers to calm down
Decoding JPEGs
▪   Large hit on UI thread


▪   Do it in a Worker?
GC
GC

     Gremlin Carnage!!
GC
▪   Garbage Collection
    ▪   V8’s Incremental GC helps
    ▪   But not always
    ▪   And not everywhere


▪   Painstaking

More Related Content

Similar to Edge conf web perf

Improving Drupal's Page Loading Performance
Improving Drupal's Page Loading PerformanceImproving Drupal's Page Loading Performance
Improving Drupal's Page Loading PerformanceWim Leers
 
Less oh-shit with git
Less oh-shit with gitLess oh-shit with git
Less oh-shit with gitRichard Tape
 
Website Speed :: Fox Valley Computing Professionals, September 2014
Website Speed :: Fox Valley Computing Professionals, September 2014Website Speed :: Fox Valley Computing Professionals, September 2014
Website Speed :: Fox Valley Computing Professionals, September 2014Straight North
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & HybridFITC
 
Get Off My Thread! - keep your UI super-responsive
Get Off My Thread! - keep your UI super-responsiveGet Off My Thread! - keep your UI super-responsive
Get Off My Thread! - keep your UI super-responsiveDroidConTLV
 
RavenDB embedded at massive scales
RavenDB embedded at massive scalesRavenDB embedded at massive scales
RavenDB embedded at massive scalesOren Eini
 
Does this FizzGood? Improve velocity, predictability & agility by asking a si...
Does this FizzGood? Improve velocity, predictability & agility by asking a si...Does this FizzGood? Improve velocity, predictability & agility by asking a si...
Does this FizzGood? Improve velocity, predictability & agility by asking a si...Jon Terry
 
Webapp Rendering and Optimization.
Webapp Rendering and Optimization.Webapp Rendering and Optimization.
Webapp Rendering and Optimization.arthurjamain
 

Similar to Edge conf web perf (8)

Improving Drupal's Page Loading Performance
Improving Drupal's Page Loading PerformanceImproving Drupal's Page Loading Performance
Improving Drupal's Page Loading Performance
 
Less oh-shit with git
Less oh-shit with gitLess oh-shit with git
Less oh-shit with git
 
Website Speed :: Fox Valley Computing Professionals, September 2014
Website Speed :: Fox Valley Computing Professionals, September 2014Website Speed :: Fox Valley Computing Professionals, September 2014
Website Speed :: Fox Valley Computing Professionals, September 2014
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & Hybrid
 
Get Off My Thread! - keep your UI super-responsive
Get Off My Thread! - keep your UI super-responsiveGet Off My Thread! - keep your UI super-responsive
Get Off My Thread! - keep your UI super-responsive
 
RavenDB embedded at massive scales
RavenDB embedded at massive scalesRavenDB embedded at massive scales
RavenDB embedded at massive scales
 
Does this FizzGood? Improve velocity, predictability & agility by asking a si...
Does this FizzGood? Improve velocity, predictability & agility by asking a si...Does this FizzGood? Improve velocity, predictability & agility by asking a si...
Does this FizzGood? Improve velocity, predictability & agility by asking a si...
 
Webapp Rendering and Optimization.
Webapp Rendering and Optimization.Webapp Rendering and Optimization.
Webapp Rendering and Optimization.
 

Edge conf web perf

  • 2. Rowan Beentje ▪ Chris Lord ▪ Pavel Feldman ▪ Shane O’Sullivan
  • 3. Top Level Topic ▪ Scrolling Lists of Complex Data ▪ Stress test for all rendering platforms ▪ Forces us to solve everything else
  • 4. Goal ▪ 60fps animation
  • 5. Fallback Goal ▪ 30fps animation ▪ Reliably, no stuttering
  • 6. Fallback Goal ▪ 30fps animation ▪ Reliably, no stuttering ▪ Often better than unreliable 60fps
  • 7. What’s stopping us? ▪ Large DOM size ▪ When to create the DOM? Upfront? Lazily? ▪ Keep it small?
  • 8. Page Reflows ▪ Keep DOM small === change it on the fly ▪ Pool of reusable DOM structures for different types ▪ E.g. with small image, large image, no image
  • 9. Measuring the DOM ▪ Changing content can make size change ▪ Must know size to inform layout ▪ But….
  • 10.
  • 11. Keep it off the UI Thread? ▪ Possible on not-web ▪ We don’t always have Workers ▪ Workers on single CPU are slow ▪ Workers can’t do DOM anyway
  • 12. Keep it off the UI Thread? ▪ Do it on the server
  • 13. So what works? ▪ Hide the scroll bar ▪ Measure when not busy ▪ Measure on the server
  • 14. Repaints ▪ Images are unpredictable ▪ Load when you don’t want… ▪ With the wrong size…. ▪ Have to be decoded
  • 15. Dealing with Image Load ▪ Defer all image loading ▪ Use low res images ▪ Show images only when time left in an animation frame
  • 16. One size fits no one ▪ Not resizing is hard ▪ Have a very strict layout ▪ Only serve the right sizes ▪ Helps to be a large corporation, not for everyone ▪ Get designers to calm down
  • 17. Decoding JPEGs ▪ Large hit on UI thread ▪ Do it in a Worker?
  • 18. GC
  • 19. GC Gremlin Carnage!!
  • 20. GC ▪ Garbage Collection ▪ V8’s Incremental GC helps ▪ But not always ▪ And not everywhere ▪ Painstaking