High-Speed HTML5@peterlubbersKaazingJune, 2011
Thanks to the SponsorsKaazing(prizes)
Enterprise-Ready HTML5 WebSocket Gateway thatallowsyou to buildmassivelyscalable, real-time web applications
HTML5 and WebSocket Training
We’rehiring!
Apress (venue, prizes)
Books for professionals by professionals
Pro HTML5 Programming: http://prohtml5.com
Yournamehere**Contact Frank Greco to belistedhere… About @peterlubbers
Not to Be Confused With…
AgendaHigh Speed HTML5 Web Apps
Tools Overview
Optimization Tips
JavaScript, CSS, Images
Image Data URIs
HTML5 Boilerplate
Server Configuration
HTML5 Web Workers
HTML5 AppCache
Q&A, Prizes#html5@peterlubbers#nychtml5
HTML5 Feature Areas
HTML5 StatusMay 24 2011: Working Draft Last Call
2012: Candidate Recommendation
Widespread adoption is around the corner
Many HTML5 featurescan be used today:http://caniuse.com
News: Modernizr v2 Launched!http://www.modernizr.com/HTML5 AppsUse HTML5 features selectively
If you're not careful, you could end up with a slow app (not cool)High Speed Web Apps
Designing Fast Web AppsApps should be focused, rich, and gorgeous, but they still need to be fast (being rich and beautiful isn't always enough!)
Improve the performance of the web app, which in turn improves the user experience
With web apps, faster isalways better (no onewill complain that your app is too fast)Time is…Measured in milliseconds!
100 ms of latency costs Amazon 1% of every saleSource: highscalability.com
0.5 second delay in content delivery is correlated with a 20% drop in traffic at Google
5 millisecond lag behind competing trading platforms could be as costly as $4 million in losses per millisecond —Marissa Mayer, GoogleHow Fast is Fast?No industry standard
Ideal web response times per W3C guidelines:
< 0.1 second = Ideal (user does not sense interruption)
1 second = Highest acceptable (downloads over 1 second interrupt the user experience)
10 seconds = Unacceptable (user is likely to leave the site)
Perceived speed matters most!Perceived SpeedAnalyze user behavior
Improve the perceived speed
Pre-load components
Example: ApplicationCache
Post-load components
Example: YUI Image Loader
Use Web WorkersOptimizing Web ApplicationsReduce HTTP overhead
Most users have Internet connections where upload to download ratios are between 1:4 and 1:20
Result: 500 byte HTTP header request could take the equivalent time to upload as 10 kB of HTTP response data takes to downloadHTTP RequestsHTTP Requests are expensive!
The majority of a page response time is consumed by downloadingresources
Consider:
Design (number of components on a page)
Location (vicinity to the web server or edge network)
Split components across domains (connection limits)Connection Limits
Performance Analysis Tools
Tools of the TradeAnalysis tools provide metrics that:
Show problems caused by JavaScript execution, loading of network resources, layout, CSS, etc.
Break down the problems in an easy-to-read format so you can target and resolve problems quickly
Built-in browser tools
Great (free) tools for performance analysisBuilt-In Developer Tools
Performance Testing ToolsGreat and free Tools:
Page Speed
Chrome Speed Tracer
Yslow (for Firebug)
WiresharkPage Speedhttp://pagespeed.googlelabs.com

High-Speed HTML5