Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Building a fast web experience [beta]
1. Building A Fast Web Experience Internet Explorer 9 Is All Around Fast Presenter Name Presenter Title
2. Expectations are Rising for the Web The capabilities of the web are increasing every day, but the way we experience the web isn’t keeping up. 2
3. Agenda Case Study - The Wall Street Journal The Browser Subsystems Deep Dive – Network and Caching Subsystem Deep Dive – JavaScript Engine Deep Dive – Hardware Accelerated HTML5 3
13. Browser Subsystems Rendering Layout Block Building Formatting DOM Marshalling JavaScript Collections CSS HTML Networking
14. Picking Five Popular News Sites 14 Wall Street Journal Chicago Tribune USA Today New York Times Washington Post CNN News Seattle Times MSN News Financial Times Boston Globe News Site #1 News Site #2 News Site #3 News Site #4 News Site #5
15. 15 Five Popular News Sites JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
16. Variation in Total Size 16 Five Popular News Sites JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
17. Number Elements to Number of CSS Rules 17 Five Popular News Sites JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
18. Number of Images 18 Five Popular News Sites JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
19. Amount of JavaScript 19 Five Popular News Sites JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
20. Amount of JavaScript 20 Five Popular News Sites JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
21. 21 Which sites loads the fastest? JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
22. 22 Which sites loads the slowest? JQuery Prototype MooTools Scriptaculous Other (JS Lib) YUI
57. Better performance, with the same markup! New JavaScript Engine – “Chakra” Foreground Source Code Parser AST Interpreter ByteCode Background Compiler Native Code Background Compiled JavaScript In The Background Using Multiple Cores 40
67. 1 2 3 4 5 6 7 8 Windows Experience Index Results - GPU 50 15% 32% 27% 10% 4% 12% Windows Experience Index Graphics Scores of Vista and Win7 Users
68. Understanding GPU Acceleration 51 Better performance, with the same markup! Images & video are downloaded, decoded & transferred into intermediate GPU buffers Complex page elements (incl. canvas & SVG) are drawn into intermediate GPU buffers Simple page elements are drawn directly to Web page buffer Intermediate GPU buffers are composited with directly-drawn content to form the visible Web page Windows Desktop Windows Manager composes the final screen 1 2 3 4 5 Content Rendering Page Composition Desktop Composition
69. Full vs. Partial Acceleration Internet Explorer 9 provides full hardware acceleration 52
70. Building Better Experiences With The GPU Don’t be afraid of high resolution images Use the GPU to scale and resize images Use lots of alpha to create beautiful compositions 53
73. 56 Using Script To Determine If A Video Code Is Supported try { var v = document.createElement("video"); if (v && v.canPlayType&& v.canPlayType("video/mp4").match(/^(probably|maybe)$/i)) { // Browser can likely play MPEG-4 video } else { // Browser cannot play MPEG-4 video } } catch (e) { // Exception when testing for MPEG-4 Playback } Providing Multiple Video Sources To Support Multiple Browsers <video id="myVideo"> <source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> <source src="video.ogv" type='video/ogg; codecs="theora, vorbis"'> <!-- Insert Silverlight or Flash Video Fallback Here --> </video> Providing Video
75. 58 function BuildUI2() { var elm = document.getElementById('ui'); // Generate UI var contents = BuildTitle() + BuildBody() + BuildFooter(); // Replace existing contents with UI elm.innerHTML = contents; } Batch Visual Changes 1 innerHTML Reference = 1 Visual Update
76. Internet Explorer 9 59 Network and Caching Chakra, the new JavaScript Engine Hardware Accelerated Graphics Networking and caching improvements mean Internet Explorer 9 performs far fewer HTTP requests when navigating. Chakra interprets, compiles, and executes code in parallel, taking advantage of multi-CPU cores through Windows and the computer’s hardware. For Internet Explorer 9, rendering of graphics, text, and video has been moved from the CPU to the graphics card.
77. Internet Explorer 9 Beta: Now Available 60 Migrate your applications off Internet Explorer 6 Develop for standards first! Download and install the Internet Explorer 9 Beta and test your site! Learn more at… http://msdn.com/ie 60