Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Special Agent You: Jank Detective

Special Agent You: Jank Detective

Rachel Smith

April 14, 2016
Tweet

More Decks by Rachel Smith

Other Decks in Technology

Transcript

  1. wtf confused why so janky works on my machine SPECIAL

    AGENT YOU: JANK DETECTIVE SPECIAL AGENT YOU: JANK DETECTIVE rachsmithtweets
  2. YOU

  3. The real problem Code or content that causes issues for:

    - the browser rendering engine. - the hardware (CPU, GPU)
  4. How a browser renders a frame STEP 1: Use HTML

    & CSS rules to create a render tree.
  5. Blink: Chrome (desktop & Android) Webkit: All Safari (and iOS

    Chrome) Gecko: Firefox EdgeHTML: Edge Trident: Internet Explorers disclaimer: not all browsers render the same way!!!
  6. Blink: Chrome (desktop & Android) Webkit: All Safari (and iOS

    Chrome) Gecko: Firefox EdgeHTML: Edge Trident: Internet Explorers disclaimer: not all browsers render the same way!!!
  7. When updating the DOM with JavaScript: • group reads and

    writes together • read & store values on events (resize, scroll, mousemove) • write property changes to DOM in requestAnimationFrame
  8. If you see a framerate drop/ jank: • record it

    in the timeline • check for CPU activity causing frames to take longer than 16ms
  9. Watch out for devices with very high resolutions. They may

    not have the GPU power to render all the pixels.
  10. Other factors: • device battery left • how many tabs/apps

    are open • available memory on the device
  11. If animation is a core part of your website/app: Test

    on real devices. Test early and test often.
  12. How can we progressively enhance animation on different hardware? currently:

    user agent + touch events + screen size + pixel density (AKA the franken-sniff) Lets be real: we can’t really.
  13. If the web really wants to keep up with the

    native world we’ll have to work out a way to provide optimal animated experiences to all devices.
  14. Thanks Chrome dev rels! Follow up with this free Udacity

    course! https://www.udacity.com/course/ browser-rendering-optimization-- ud860 I’ll tweet the link @rachsmithtweets
  15. b