Intro to #perfLife • How we have optimized code in the past • How we measured performance in the past • New ways to optimize your code • What metrics we should be measuring • What tools are available to measure performance • Technology that can help us moving forward
Responsive Revolution • Ethan Marcotte • Before we had fixed width pages and separate mobile sites • Now we could make sites adapt to different screen sizes
Optimizing Code in the Past • Condense CSS and JS files • Removes white spaces • Makes file sizes smaller • Hard to read minified files: keep a dev copy to make changes
Performance Today: Benchmarks • User Experience: How fast until… • the user seeing the first paint? (Start Render) • the above the fold content is loaded? • the document is interactive?
Performance Today: UX is Important! • DUH…better UX! (Keep the user in mind!) • SEO • Fast sites = better rankings (Google) • TTFB possible determining factor (websiteoptimization.com)
Performance Today • New HTML Elements • • Load different images for different screen sizes • Load different types of file types • Falls back to if all else fails…
Case Study • Optimized photos • Moved scripts to the bottom of • Created a sprite • Put all scripts in 1 file, Put all CSS in 1 file • Minified scripts and CSS
What to Measure • Backend Load Time • # of redirects • # of requests • TTFB • Frontend Load Time • Start Render • Speed Index • Visually Complete • Total Load Time
How to Measure • RUM (Real User Measurement) • Gather data from actual users/devices • Measure performance for different locations • Synthetic Testing • Gather data from actual devices/browsers • See non-cached “first view” measurements
Synthetic Tools • Uses real devices to collect tons of data • Gives “first view” and “repeat view” data • Test website from multiple locations • New Relic • WebPageTest.org • Nines
Synthetic Tools • Uses real devices to collect tons of data • Gives “first view” and “repeat view” data • Test website from multiple locations • New Relic • WebPageTest.org • Nines
Future of Performance • UX will affect SEO more • HTTP2 and SPDY • Prefetch & Prerender • Use SEO to determine user behavior • Prefetch images, js, and/or css needed for the next page to cache • User clicks on link and page loads from cache
Future of Performance • Use microseconds instead of standard milliseconds using High Resolution Timing (IE 10+, Chrome, Opera, FF, Android) • User Timing API to meausure AJAX requests, script loading, script execution, etc. (IE 10+, Chrome, Opera, Android) • Beacons: send performance data async whenever the current page is unloaded (Chrome, FF, Opera)
Future of Performance • Navigation Error Logging Javascript API: Get RUM data of when and how a page failed to load (i.e. DNS lookup, connection timeout, reset connection, etc.) (No support yet)
#perfMatters • Optimize code and images • Measure RUM and Synthetic testing using tools available • Embrace the new APIs to measure UX and performance bit.ly/ninesperf