New Perspectives On Web Design

(C. Jardin) #1
By Addy Osmani CHAPTER 6


  1. Check the Timeline for any frames that went over budget (i.e. that are
    below that ideal 60fps). If you’re close to the budget, then you’re likely
    way over budget on mobile. Aim to complete all of your work within
    10ms to have some margin. Note that this margin is for slower devic-
    es and you should almost certainly run this analysis on mobile using
    remote debugging^16 (if building for mobile, which you should be!).

  2. Once you’ve noticed you have a janky frame, check what the cause of it
    was. Was it a huge paint? CSS layout issue? JavaScript?

  3. Fix the problem. If it was a paint or layout issue:
    i. Go to Settings and enable “Continuous page repainting.”
    ii. Walk through the DOM tree, hiding non-essential elements using
    the hide (H) shortcut. You might discover hiding particular elements
    makes a large difference to your paint times and frame rate.
    iii. We now know there is something about an element that has
    slowed painting down. Uncheck styles that could have an impact
    on paint time (e.g. box-shadow) for the element and check your
    frame rate again.
    iv. Continue until you’ve located the style responsible for the
    slowdown.

  4. Rinse and repeat.


16 http://smashed.by/remote

Free download pdf