понедельник, 15 октября 2012 г.

Update: Effectively Protecting Consumers from Online Tracking


Since December’s technology announcement about IE9’s Tracking Protection feature, we’ve seen a lot of interest from press, academics, governments, and industry groups. This blog post is an update based on the conversations we’ve had on this topic – visiting with government and industry groups in Europe last week, faculty and students at a joint Harvard-Stanford Law School class earlier this month, and with the Wall Street Journal / All Things D at the Consumer Electronics Show earlier this month as well. It’s another example of our approach to developing IE9 transparently and with the engagement of many different communities.
Privacy is a worldwide conversation and, at the same time, it is intensely local. Local sensibilities and expectations differ from Germany to the UK to Japan to the United States. One size can’t fit all. Privacy is a broad topic, ranging from Street View issues to medical record disclosure.
IE9’s Tracking Protection focuses on the issue of online tracking. Consumers on the Web are tracked every day without their awareness or permission. As a result, there is growing consumer concern and suspicion about tracking. That theme was consistent across the conversations visiting government agencies and industry groups in the United States last month as well as the conversations in Europe last week.
IE9’s Tracking Protection is a technology that enables governments and organizations and enthusiasts to better protect consumers from tracking. This technology works within and complements the privacy frameworks being developed worldwide. It is an effective way to put effective consumer privacy protections into operation.

Progress and News with Standardization and Lists

To protect consumers, having Tracking Protection work consistently across browsers is important. In December, we made the underlying format for Tracking Protection available under a Creative Commons Attribution licenseand the Microsoft Open Specification Promise so that they same lists can work in other browsers. Since then, the premier Web standards body, the W3C, has contacted us about standardizing the format. We are taking the next steps with the W3C to standardization.
We’ve had many conversations with governments, organizations, and interested individuals both in the United States as well as Europe about our approach. The feedback has been positive. Earlier this week, the European Privacy Association stated publicly that it welcomes this feature and the empowerment it will bring. In December, the Chairman of the US Federal Trade Commission, Jon Leibowitz, said “Microsoft deserves enormous credit for taking a critical step toward providing consumers with more choice about who can track their online browsing. Just as important, this announcement proves that technology is available to let consumers control tracking.” In an interview with the Washington Post in December, Viviane Reding, the vice president of the EU Justice Commission and head of privacy regulation, responded to the inclusion of these privacy features in IE9 by saying “this is the right direction and what is important is that industry has understood it can’t ignore privacy concerns. If they want to be efficient, they have to have privacy enhancing tools build in. And companies want legal certainty about privacy.”
The development of Tracking Protection Lists, for both US and European consumers, is underway. Several consumer privacy organizations have preliminary lists in testing. Some advertising industry groups, recognizing how Tracking Protection enables more effective self-regulation, are also in the process of developing Tracking Protection Lists. They have been clear and articulate about their point of view that ads and tracking are different, separate things. We’re excited to see them put that point of view into practice.
An interesting non-advertising scenario came up in conversations with some government agencies last week. There was concern that with all the tracking content on websites today, it would be possible (for example) for an entity on the Web to determine that several machines in a Defense Ministry were checking the weather in a particular part of the world, or that many browsers in the Healthcare Ministry showed a spike in visits to articles on a particular topic. There may be similar concerns for businesses, for example in finance, in a tracking agent paying close attention to the Web browsing patterns of employees. Tracking Protection functionality will work with the enterprise deployment and management tools available in Windows.

How Tracking Protection Works and Alternative Approaches

Tracking Protection works by blocking content that can be used to track you on the Web.
Typical Web pages that you visit are a mosaic of content from all over the Web. For example, if you look at these screen shots, or use developer tools in the browser, you can see how much content on a Web page comes from sites other than the one in your address bar. Cookies are just one of many ways that tracking happens; you can see examples of tracking pixels in the screen shots linked to above.
To turn on tracking protection, a user just clicks on a special link in a Web page. All their browsing across the Web, from then on, is protected from tracking until the user explicitly turns it off. Clicking that link adds aTracking Protection List of Web addresses (like “msdn.com”) that the browser will block (unless the user visits them directly and can see them in the address bar). By limiting how the browser visits certain websites, Tracking Protection limits the information these sites can collect. (These lists also accommodate “allow” as well as “block” rules; please see the earlier technical post for more detail.) The system is open in that any Web site can host these links and lists, and any person can author and share a list.
This approach enables consumers to have push-button simplicity (just find a site and click a link) while leaving privacy and industry experts and enthusiasts the flexibility and freedom to provide consumers great guidance and recommendations on their own websites that offer Tracking Protection lists. As consumers find pages and lists that they like and trust, they can share them (via email, blog, Facebook, Twitter, etc.) and engage in privacy awareness.
Earlier this week other browser providers made announcements regarding alternative approaches to privacyprotection. The specifics of the proposals are under active discussion on the Web (here for example, and hereor here). What’s most important is that consumers have effective privacy protections to go along with great browser performance and an experience that puts the focus where it belongs: on the Web, not the browser.
—Dean Hachamovitch, Corporate Vice President, Internet Explorer

HTML5 Blizzard: Full Hardware Acceleration in Action


With Internet Explorer 9 the entire web platform is fully hardware accelerated. Customers will benefit from hardware acceleration on all of the websites they visit and developers will benefit from hardware acceleration across all of the technologies they use (HTML4, HTML5, SVG, CSS, JavaScript, Audio, Video, and more).
We’re excited that other browser vendors have decided to follow our lead and hardware accelerate their browsers. We’re moving the web forward together in a way that greatly benefits customers and enables new web experiences. Browser vendors have taken different architectural approaches to hardware acceleration, both in what web platform technologies they hardware accelerate and how much they accelerate these through hardware (GPU, multi-processor cores, memory locations, etc.).
This post looks at the HTML5 Blizzard demo which we released to wish everyone a happy holiday season. The HTML5 Blizzard demo uses common web technologies together to see how many snowflakes a browser can animate in real-time (60fps). When the frame rate is above 60fps snowflakes are added, and when the frame rate falls below 60fps snowflakes are removed, until the browser reaches equilibrium at 60fps. The more snowflakes the browser can animate in real-time the higher the snowflake score.
A browser which only hardware accelerates some of the technologies used in HTML5 Blizzard will have a lower snowflake score than a browser which efficiently uses the PC’s resources to hardware accelerate the entire experience together.

Step-by-step: How HTML5 Blizzard Works

Background Sky (HTML5 Canvas Gradient)Background Sky (HTML5 Canvas Gradient)
The blue background of the Blizzard demo uses the canvas API’s to programmatically create a linear gradient brush and draws the gradient into the background canvas. This entire process is hardware accelerated in IE9 and creates a background sky for the scene.
Holiday Greetings (DIV with WOFF Font)Holiday Greetings (DIV with WOFF Font)
Located over the background are two fixed position HTML DIV’s containing text wishing everyone happy holidays. These DIV’s are styled using standard CSS properties and drawn with a WOFF font. All text within IE9 including text styled with user provided WOFF fonts is hardware accelerated.
Snow Bank (SVG Image)Snow Bank (SVG Image)
Along the bottom of the window is a vector SVG image representing the snow bank. By using SVG we can dynamically scale the image to the width of the window and maintain smooth, anti-aliased curves. Within IE9 all SVG graphics are represented natively on the GPU and hardware accelerated.
Snowman (HTML5 Canvas Images)Snowman (HTML5 Canvas Images)
No winter scene is complete without a dancing snowman, and located in the center of the screen is second canvas where we draw images at different rotations and scales with common JavaScript animation techniques to create the effect of the dancing snowman. Rotating, scaling, and drawing images is massively parallel on the GPU and this entire process takes place on the GPU with IE9.
Snowflake Score (HTML5 Canvas Text)Snowflake Score (HTML5 Canvas Text)
Being a performance demo we need to show people how many snowflakes are falling on the screen and we do that through the HTML5 Canvas text capabilities which allow us to draw text directly into a canvas surface. You’re starting to see a pattern – drawing and compositing this text is also hardware accelerated with IE9.
Falling Snowflakes (HTML5 Canvas Image Strip)Falling Snowflakes (HTML5 Canvas Image Strip)
The fun part of the demo is the snowstorm canvas which programmatically adds and removes snowflakes until it reaches the 60fps (16.7ms) equilibrium point. The snowflakes are drawn from a single indexed image strip and all indexing and clipping of that image strip occurs on the GPU within IE9.
Return Button (DIV with CSS3 Opacity)
Like many webpages there’s a button which allows the user to return to the sites homepage. This button sites at the top of the z-order above all other content and uses the CSS3 Opacity property to blend into the background scene. Within IE9 applying these CSS3 properties occurs entirely through the GPU.
Information Pane (WOFF into HTML5 Canvas Text)Information Pane (WOFF into HTML5 Canvas Text)
Along the bottom of the scene you’ll find general performance information, including the current window size and how long it takes to draw a single animated frame. This information is drawn into an opaque canvas using the canvas text capabilities and WOFF fonts. This is a good example of how performance benefits compound within IE9 when features which are individually hardware accelerated (Canvas, Canvas Text and WOFF fonts) are used together.
Background Music (HTML5 Audio)Background Music (HTML5 Audio)
On browsers which support playing MP3 audio files through the HTML5 Audio tag, holiday music will play in the background while the demo is running. Within IE9 we take advantage of the audio hardware available to perform audio decoding and playback directly on hardware when possible.
Bringing the Demo TogetherBringing the Demo Together
These individual web platform features come together to create a fun and fully hardware accelerated winter scene. Everything you see in the demo is represented as native graphics primitives directly on the GPU.

Full Hardware Acceleration

An objective of Internet Explorer 9 is to provide the right foundation across the browser to ensure developers have a reliably fast platform. The HTML5 Blizzard demo is a great example of how web developers will use different technologies together in creative and natural ways. Just accelerating pieces of the web platform, such as compositing or canvas, will improve performance but doesn’t have the same impact as fully accelerating the entire web platform.
What’s your snowflake score?
—Jason Weber, Lead Program Manager, Internet Explorer Performance

четверг, 11 октября 2012 г.

HTML5, Site-Ready and Experimental


As the technologies around HTML5 continue to develop, people need a better way to distinguish the more experimental parts of HTML5 from the parts ready for use in mainstream sites. The recent browser technology kerfuffle around WebSockets offers a clear example of the problem that developers and consumers will face again and again over support for emerging standards.
With many HTML5 technologies still under active development, our approach is to give developers better choices and avoid false dichotomies around standards support. The IE9 browser has site-ready HTML5 support that developers and consumers can depend on. We will also offer developers “HTML5 Labs” for more experimental technologies still under development. By clearly separating prototype implementations from mainstream browser productones, we can avoid many negative consequences.
In the IE9 product, we’re delivering on the key parts of HTML5 that are site-ready. IE9 offers support for real-world web patterns that developers are using today as well as the HTML5 patterns we expect to become more mainstream. IE9 does this because we want to improve interoperability on the web by providing developers a consistent programming model through the same mark-up. The goal is supporting great new capabilities, ideally in a way that interoperates or will interoperate soon across browsers.
We will also offer prototype implementations for the more experimental or unfinished parts of HTML5 that some developers may want to try, but consumers can’t depend on yet. We will be explicit about the implementations that are more prototype than product. These prototypes are how we balance providing a product for millions of consumers while actively engaging in speculative technology discussions with developers and enthusiasts and avoid confusing either group. You can read more about that here.
In this post, we look at the pattern of putting unfinished technology into a product, the negative consequences of doing that, and our alternative approach for other HTML5 technologies that are still under construction today.

The WebSockets

First, WebSockets are a good idea.
They are both a technology and a set of standards that are under construction. They’re often included as part of the HTML5 discussion. With WebSockets, browsers and sites can do some neat things that are otherwise very hard, very slow, or not possible. You can see videos of some scenarios enabled at http://www.websockets.org/ – a site not actually related to any of the organizations working on the standard, but from a company that has some product offerings in the space.
Implementing a technology while the blueprints that describe it are still changing significantly causes many problems. In this section, we’ll use the experience of WebSockets to illustrate common challenges of under construction technologies. Below, through the transparency of Mozilla’s process, you can read for yourself how several different problems played out.
This is a view into the difficult discussions and decisions around a technology under construction: guarantees that websites will break multiple times between today and when the technology is finished, the security risks to people using the technology, and the challenge of listening to a lot of contradictory feedback.
Let’s look at bug number 602028 in Bugzilla, Mozilla’s issue tracking system. For people less interested in these details, this is a good place to skip ahead to the next section.
This bug was first reported 5 October 2010. The bug suggests initially that “while the final WebSockets protocol is sorted out,” Firefox should do “prefixing.” One of the first comments in the bug immediately stakes a position (of disagreement), and calls out the compatibility issue that developers will face writing sites that work across browsers with this technology under construction:
We most certainly should not… Prefixing in Gecko doesn't gain anybody anything… It only hurts us, because "Firefox doesn't implement HTML5". Comment 2
A subsequent comment cites the same facts – volatility and compatibility issues – as an argument in the other direction.
The reason that we want to prefix it is because we know, 100%, that it's going to change. We also know that other browsers will update it as well. We don't want it confused with… anything other than experimental and the best way to do that is prefix it as such.
The new version will not be compatible with existing implementations. Comment 7
Other comments go on to cite precedents for either course of action (here, andhere), adding “WebSockets won't exit demoware status for a few years.” That’s a powerful comment about the pace of technology adoption. Cynically, the discussion goes on that “the who's-in-the-lead perception may trump all other considerations… We [Mozilla] are… constantly eating WebKit's dust. I would lay a bet we'll do it again here.”
A key point in the discussion is that developers “can be expected to expect their server's [sic] will break as new versions of WebSockets are implemented in browsers.” A Google employee working on WebSockets goes on to add “the best strategy is to just keep breaking people.” A Mozilla person responds with his concern that this
assum[es] that the developers will have the perfect knowledge of everything that's happening on the web, what the status is of various standards are and if things are going to change. Given my personal experience that's a dangerous assumption. Comment 27
That’s when someone brings up the security issue, and another person makes the observation that it might not be worth “being able to check-off another ‘HTML 5 support’ box on the marketing slides.” Someone goes on to say what the standard should do and that they should follow it, to which someone else responds:
That would be great. Except that there is no standard yet, just a series of working drafts, with incompatible handshakes, and no plan… that doesn't simply cause servers using older handshakes to barf on newer ones. Comment 73

The Negative Consequences

First, work on WebSockets continues today and Microsoft is part of that discussion. No one should interpret this recent news as the end of WebSockets.
One tech publication wrote that “the Web Sockets history illustrates some pitfalls of the style and pace of Web standards development,” and that “including support for a specification [that] wasn't done” is just the latest wrinkle. The article’s headline describes “the risk of unfinished standards,” while another article describes “emerging Web standards like WebGL and WebSockets,” and a comment from a Mozilla leader here refers to “speculative features.”
WebSockets is just one of many, many unfinished, emerging, and speculative features. Rushing ahead with implementation while the blueprints are changing a lot creates dissatisfaction. This (warning: potentially NSFW) video dramatizes that developer dissatisfaction. That dissatisfaction is the result of supporting unfinished, emerging, and speculative features in the mainline product.
The question is how to balance the implementation of these under construction technologies (in order to resolve under construction issues) with the needs of developers (who don’t like re-writing their code over and over to get new capabilities) and the needs of consumers (who expect sites and browsers to just work). Today, iPhone and iPad 4.2 support WebSockets. Firefoxand Opera have recently disabled their implementations because of (among other things) the security and compatibility concerns.

An Alternative Approach, because WebSockets are Not Alone

One alternative approach to these experimental features is being much more explicit about implementations that are more prototype than product. This is the approach Microsoft is taking. You can read more about it here. Through these prototypes we balance the objective of providing a product for millions of consumers and engaging in early speculative discussions with developers and enthusiasts, without confusing either group.
There are many other technologies under development today that are still under construction. Because they are not site-ready today and will not be ready, relevant, and real-world before we release the IE9 product, these emerging standards are susceptible to the same problems and negative consequences that WebSockets has faced. Some technologies are in transition and being reconciled with others (or potentially abandoned in favor of others). SMIL animations and SVG fonts, though they are used in the Acid 3 test, are on the way out in favor of CSS animations and WOFF. The Web SQL specification, for example, was formally taken off the Recommendation track at the most recent TPAC with the emergence of IndexedDB as a better path.  IndexedDB is itself an emerging and unfinished standard, along with WebSockets, the File API and WebGL (as the Ars Technica article above points out).
Site-ready also looks at the larger context of developer needs today and tomorrow and the viable alternatives as well as the state of the standards process. For example, CSS3 is anenormous set of technologies. IE9 already implements many CSS3 modules that are site-ready. Several other CSS modules (like CSS3 Gradients) are still emerging and unfinished. Other modules have perfectly fine interoperable alternatives, like using script in place of CSS3 Transitions and CSS3 Animations. For other technologies, like web workers, other considerations apply as well. Web workers introduce complex multi-threaded programming concepts to JavaScript, and require extensive prototyping (just like WebSockets) to fully explore the impact on developers and the broader web programming model.
There are many technologies that can easily play out the way WebSockets have. Developers and consumers are better off if these technologies are brought forward as explicit prototypes rather than in the product that so many people depend on. WebSockets and the IndexedDB web storage are the first prototypes in the new program. Some experimental CSS3 modules are potential candidates for prototypes, along with other technologies (e.g. the File API). This is a process we’re excited to work through with the community.

Looking Ahead

In developing IE9, we considered how different specifications are still evolving at different rates. IE9 supports technologies that, while not always finished, are developed enough to avoid the problems that WebSockets illustrate today.
In the IE9 product, developers can expect site-ready HTML5 so they can take advantage of the best of HTML5 that is ready and can still experiment with emerging HTML5 with HTML5 Labs. By keeping these separate, developers get what they need without the negative consequences of co-mingling very different things in the same browser.
IE9 offers support for the most relevant, real-world web patterns that developers are using today as well as the HTML5 patterns we expect to become more mainstream. By relevant and real-world, we mean the technologies with the broadest impact for browser users (e.g. CSS ahead of MathML). By support, we mean providing developers a consistent programming model that enables the same mark-up. The goal is supporting great new capabilities, ideally in a way that interoperates or will interoperate soon across browsers.
This approach (along with its supporting points, like test suites and “same markup” as a goal) has garnered strong support from developers. It’s also resulted in some surprising headlines over the last year, like “Only Microsoft gets web standards” according to “Mozilla man [who] blasts Apple and Google for HTML5 abuse,” from The Register.
In this context of unfinished technology, measuring how much HTML5 different browsers support through “benchmarks” does not make much sense. In particular, many of these tests (like Acid 3) include different partial collections of unfinished standards, while they exclude deep or broad assessments of the quality of the implementations. The key questions for tests are how appropriate is their scope, how accurate and rigorous are the individual tests, and how comprehensive is their coverage. The standards bodies involved in the process of developing the standards (like W3C and Ecma) are a great forum for the development of trustworthy, high-quality tests.
Professional website developers are busy. They write a code for a living and genuinely don’t have the spare time to wade through comments on all these under construction specifications and keep track of every build of every browser. With this approach, we make it easier to take advantage of the capabilities that are stable and ready for prime time.  We remove much of the guess work for developers of working with a moving target. The result is more time for site developers to innovate and create better web experiences.
Back in March when we released the first platform preview of IE9, we were clear that we love HTML5 so much we want it to actually work. One aspect of that involves using the whole PC to run HTML with the best performance. Another aspect is working with community and standards bodies on test suites. Making sure that developers avoid the frustration of wasted time re-writing sites over and over as technologies change – and that consumers avoid frustration of sites that break easily – is just as important.
Thanks,
Dean Hachamovitch

Happy Hardware Accelerated Holidays


Here are two new HTML5 experiences you can run in your browser, designed in the spirit of the holiday season and with hardware accelerated HTML5 in mind.
Check out Santa’s Workshop, where the speed of your browser on your PC determines how many elves help pack Santa’s bag for the big night, and how fast they work. We built this experience using HTML5 technologies like integrated SVG graphics and HTML5 audio.
Santa's Workshop demo
See how big of a storm your browser and your PC can kick up with HTML5 Blizzard. Your snowflake score shows you how many falling snowflakes can be animated in real time (60FPS). The more snowflakes you see, the faster your browser and PC. This experience combines HTML5 canvas, SVG, audio, CSS3 and WOFF fonts together to create a winter wonderland.
HTML5 Blizzard demo
Just over a year ago we presented the earliest look at IE9 and how browsing experiences are better through the power of underlying hardware and operating system. Starting in March atMIX 2010, and throughout the year, we demonstrated our approach to bringing full hardware acceleration to the web in IE9. We showed continuing progress with the release of seven platform previews, the IE9 beta, and through samples on the IE test drive site.
We showed how web applications built on the next generation of hardware accelerated HTML5 approach the level of interactivity and performance found in native apps, and we had some funalong the way (as did many partners) – we hope you did as well.

Thank you!

Your participation and feedback is an important part of how we build IE9. Today we want to saythank you to everyone who has downloaded IE9 beta and previews, run the test drives, reported issues on Connect, or submitted feedback through the Send Feedback (alt+X, K) in IE9 beta. We also want to thank the people and groups who make the standards process work, the broad community of web developers, and enthusiastic consumers who work to move the web forward.
From the entire IE team, we wish you a happy hardware accelerated Holiday season, and we look forward to another exciting year on the web in 2011.
Rob Mauceri
Group Program Manager, IE

Web Platform Docs Debuts with Developer Resources


Today, we are taking another step forward in helping developers achieve the goal of interoperability through same markup. We’re happy to be part of creating Web Platform Docs (WPD), a new W3C hosted community resource for developers and designers who use open Web standards. For developers the Web is about building great experiences with the potential to reach millions of people around the world by writing interoperable sites and applications. We’ve talked many times about the promise of interoperability through the same standards-based markup yielding the same results.
Web Platform Docs (WPD)
The W3C, Adobe, Apple, Facebook, Google, HP, Microsoft, Mozilla, Nokia and Opera have teamed up to create and seed this new community-driven site whose aim is to become a central repository for Web developer documentation.
  • Clear reference docs that are accurate, complete, and indicate adoption rate.
  • Thoughtful tutorials for existing and new technologies.
  • A sample library that takes into account real-world scenarios.
  • The ability to see—at a glance—which technologies are on a standard track and the stability and implementation status of features.
WPD uses MediaWiki as its platform, and in the model of Wikipedia, WPD’s strength comes from a global assembly of volunteer developer contributors. Anyone can become a member, anyone can contribute, and the resulting community creates and manages the content through collaboration and mitigation. The W3C is the site’s convener and administrator. The founding organizations (and others who wish to join with financial support for the project) are known asstewards. The stewards help in infrastructure decisions and will have members act as contributors with the same rights as every other member who joins on their own. The stewards seeded WPD with topics donated from already-published content (over 3,200 topics from MSDN) and will continue to add content moving forward.
We view this as an opportunity to combine our information with that of other creators of developer content in a way in which the whole will become greater than the sum of its parts. Having developer content assembled in WPD means the data that’s important to your planning is centrally located and accurate. You won’t have to look at competing sites and wrestle with conflicting information. At the same time, evolving or proprietary APIs will be included, and they will be clearly marked as such. And when a topic is missing information or contains an error, you can flag it for a community member to update—or do it yourself.
It has been a pleasure and an honor working with our global and diverse partners in making this site a reality, and this is just the beginning for WPD. Creating a comprehensive standard reference library that drives standard adoption will take an ongoing concerted effort. We believe that part of building a highly interoperable Web browser means providing developers with the resources to achieve an environment where the same code and markup delivers the same results. And that makes the Web better for everyone.
— Eliot Graff, Content Publishing, Internet Explorer

Security Advisory 2755801 Revised to Address Adobe Flash Player Issues


Today we released an update that addresses vulnerabilities in Adobe Flash Player in Internet Explorer 10 on Windows 8. The majority of customers have automatic updates enabled and will not need to take any action because the update will be downloaded and installed automatically. For those manually updating, we encourage you to apply this update as quickly as possible.
This update addresses the vulnerabilities in Adobe Flash Player by updating the affected Adobe Flash binaries contained within Internet Explorer 10. For more information, see the advisory.
— Vishwac Sena Kannan, Program Manager, Internet Explorer

воскресенье, 7 октября 2012 г.

HTML5, and Real World Site Performance: Seventh IE9 Platform Preview Available for Developers


Performance on the web is multi-dimensional. Real websites call on many different browser subsystems to deliver amazing experiences. Each browser subsystem in turn has its own performance characteristics. The chart here and the diagrams in this postdescribe the specific subsystems like JavaScript and graphics rendering and more in detail.
Over the last few weeks, we’ve been tuning the JavaScript engine for more of the patterns we’ve found in real world sites. Based on the progress since the last platform preview, we’re releasing an updated platform preview build today so developers can try it out and provide feedback about the changes. Here’s a video of the changes in action:
Stepping back from these striking differences, let’s look at the big picture. JavaScript performance is one part of one aspect of performance. In addition to the other parts of the browser platform (like graphics rendering), performance involves other aspects as well: how well does the browser guard the user from slow add-ons, or from unreliable sites that crash? Enabling users to pin websites to the Windows taskbar means that users can go directly to sites without having to launch the browser and navigate. Making the most of your device for web browsing is significant as well. Taking advantage of the whole PC, and using the specialized graphics hardware and the many cores that modern PCs typically include, offers huge performance gains.

Tuning the JavaScript Engine for Real world patterns

Real world websites use JavaScript to respond to user input, manipulate strings, and move objects around the screen, and much more. We looked at common patterns and made adjustments to IE9’s script engine. You can try these examples (and more) atwww.ietestdrive.com.
Running these sites in other browsers like the latest Google Chrome or FireFox 4, shows significant performance differences. InShakespeare’s Tag Cloud, you see the performance advantage of compiled JavaScript and ECMAScript5 support with script-intensive operations. IE9 can run through a large body of text and build a tag cloud much more quickly. That same ECMAScript5 support combined with HTML5 Canvas delivers an HTML5 Sudoku solver that can solve puzzles faster than other browsers running the same site. With Galactic, you see fast JavaScript and hardware accelerated graphics together creating a 3D interactive experience. The frame rate in IE9 is significantly better than what the other browsers do today.

The Webkit SunSpider Microbenchmark

One measure of some aspects of JavaScript performance is the Webkit Sunspider microbenchmark. Remember that JavaScript is just one component of many that define browser performance on real world sites. Here is a chart of the latest results:
Webkit Sunspider JavaScript Benchmark Results.  IE9 Platform Preview 7 is fastest followed by Chrome 8 Beta, Opera 11 Alpha, Opera 10.63, Chrome 7, FF 4 Pre-Release, Safari 5.0.2, FF 3.6.12 and IE8.
You may notice that the relative positions of browsers on this chart have changed with the latest IE9 Platform Preview.
We’ve gotten some questions after the last few Platform Previews about this chart. The results in the graph are from running actual browsers (in a consistent lab setup), just as we have since we started publishing the chart. Reporting results that “rely on a ‘shell’ JS engine that runs in a command line” is odd because those results don’t reflect the user’s experience in a browser. Similarly, because the point of a browser is to run actual websites, not just benchmarks, the chart we publish continues to include two versions of each other browser. You can read more on this choice at the end of this post.
You may also notice that the differences between browsers on this microbenchmark are converging within thousandths of a second on tests that repeat operations many, many times to find any differences at all. Some have suggested that this benchmark doesn’t matter now and it’s time for another JavaScript microbenchmark.
We’ve been consistent in our point of view that these tests are at best not very useful, and at worst misleading. Even with the most recent results in the chart above, our motivations and our point of view remain unchanged. We’ve focused on improving real world site performance. We’ve made progress on some microbenchmarks as a side effect. Focusing on another subsystem microbenchmark is not very useful.

Microbenchmarks and Real world web patterns have little in common

We think people should evaluate browser performance with real-world scenarios. Real-world scenarios involve using all the subsystems in the browser together rather than looking at single subsystems in isolation. Using a narrow slice of features to assess the big picture makes as little sense here as using the “Acid” tests to understand standards compliance.
Microbenchmarks isolate very narrow and specific aspects of a system. That’s the opposite of real-world websites that use the different subsystems together in order to deliver something useful or entertaining. Microbenchmark results often have little in common with the actual user experience of sites; for example, comparing JavaScript ray tracing or Fourier transforms is a good measure if that’s what the sites you rely on actually do. Performance on the test drive site samples has not, to date, looked like the Webkit SunSpider graph because there’s more to real world performance than JavaScript. The work at the W3C with other browser developerson a web standard to help developers measure and understand the performance of their website is a powerful statement about how much more there is to performance than JavaScript.
This Channel 9 interview with Jason Weber (a Lead Program Manager on the IE team focused on performance) is worth watching if you’re interested in hearing more about the difference between real world performance and microbenchmarks,
The IE Test Drive site offers samples that run in all browsers and deliberately represent real-world site patterns rather than microbenchmark-style samples. The visualization of the real-world samples is often more fun than a graph, as with Galactic, browser hunt and speed reading. The performance differences between browsers can be striking. They reflect how we’ve designed for real world, end-to-end performance rather than tuning subsystems for microbenchmarks.

Previews with Meaning

Back in March, we committed to delivering public Platform Preview Builds to the developer community on a regular schedule leading up to the IE9 beta. Feedback about these previews from developers has made both the IE9 development process and the IE9 release itself significantly different from previous IE releases.
This latest Platform Preview comes about two and half weeks after the most recent Preview. Leading up to the IE9 beta, we released Platform Previews approximately every eight weeks. We have internal builds of IE at least once a day, often more. Why not release public “dailies” and “nightlies” of IE?
The cadence of IE Platform Previews reflects our point of view: the point of a browser is to run actual websites, not just benchmarks or samples that are hardwired for one browser. Our point of view starts with providing consistent quality to respect customers’ time and includes delivering meaningful progress with each Platform Preview.
Twenty four hours of elapsed time is rarely meaningful. “Nightlies” vary widely in performance and quality, and may not run actual websites successfully. Those daily builds are of some interest to a small audience of “insider” enthusiasts who often take activity (evenincrementing the version number) as progress. The gap between the IE Platform Preview download numbers (in the millions) and the other browsers’ pre-release offerings reflects this difference.
Looking ahead, we will continue to improve IE9’s performance. Making the full power of the PC available to websites is part of our focus on real-world sites and real-world performance. We’ll continue to work with the W3C and other browser developers to deliver on the goal of the same markup (the same HTML, CSS, and script) working across browsers. We’ll continue to take a holistic approach to the browser experience and platform and safety. We’ll also continue to release at a cadence that provides meaningful builds for the community to provide meaningful feedback.
Dean Hachamovitch
Update 1:10pm – There have been some questions raised about how a particular optimization in the Chakra engine is affecting IE9’s Webkit Sunspider results. The below addition addresses these questions.

Dead Code Elimination in JavaScript

One of the changes we made to the IE9 JavaScript Engine, codenamed Chakra, to improve performance on real world web sites involves dead code elimination. Yesterday afternoon, someone posted a question (“What sorts of code does the analysis work on, other than the exact [math-cordic test] function included in SunSpider,”) on the Microsoft Connect feedback site. Given some recent interest in this question, this blog answers that question.
Briefly, the IE9 JavaScript engine includes many different changes to improve the performance of real-world Web sites and applications. You can see this in action by visiting www.ietestdrive.com and trying the samples there with IE9 and other browsers. The behavior of the IE9 JavaScript engine is not a “special case optimization” for any benchmark and not a bug.
Some of the optimizations we’ve made to the JavaScript interpreter/compiler in IE9 are of a type known in the compiler world as dead code elimination. Dead code elimination optimizations look for code that has no effect on a running program, and removes the code from the program. This has a benefit of both reducing the size of the compiled program in memory and running the program faster.
Here is a very simple example of JavaScript code that is a candidate for dead code elimination. Because the conditional will always evaluate to false, the JavaScript engine can eliminate this code altogether.
function func() {
    var x = 1;
    var y = 3;
    var w = x + y;

    if (w != 4) {
        // dead code 
    }
}
Dead code elimination is especially effective when code would be executed many times, as in a loop. In the following example, the code in the loop repeatedly overwrites the same variable (what is known in computer science as a dead store), so it can be reduced to only one call.
function func(a, b) {
    var x;
    var i = 300;
    while (i--) {
        x = a + b; // dead store
    }
}
In the example below, the code executed in the loop is not used anywhere in the program outside the loop, so the entire loop can be safely removed.
function sum() {
    var a = [1, 2, 3, 4, 5];
    var sum = 0.0;
    
    // dead loop elimination
    for (var i = 0; i < 5; i++) {
        sum += a[i];
    }
}
Developers often write dead code without knowing it and can rely on compilers to optimize the code. Most modern compilers today run an extensive set of dead code elimination optimizations.
So, why does this affect the math-cordic benchmark in the Webkit SunSpider suite? Let’s take a look at the inner function in the test.
function cordicsincos() { 
     var X;  
     var Y;  
     var TargetAngle; 
     var CurrAngle;  
     var Step;   
     X = FIXED(AG_CONST);         /* AG_CONST * cos(0) */ 
     Y = 0;                       /* AG_CONST * sin(0) */ 
   
    TargetAngle = FIXED(28.027);  
    CurrAngle = 0;  
    for (Step = 0; Step < 12; Step++) { 
        var NewX; 
            if (TargetAngle > CurrAngle) { 
               NewX = X - (Y >> Step);  
               Y = (X >> Step) + Y; 
               X = NewX; 
               CurrAngle += Angles[Step];  
            } else { 
               NewX = X + (Y >> Step); 
               Y = -(X >> Step) + Y; 
               X = NewX; 
               CurrAngle -= Angles[Step]; 
            } 
    } 
} 
The benchmark runs an expensive loop, and then does nothing with the results; the benchmark is written exactly in a way that triggers this general optimization.
Of course, the benchmark could be rewritten to avoid triggering this optimization, which would bring our performance on this specific benchmark in line with other browsers.
The interest in this issue is a great example of why these microbenchmarks fail to represent the real world web. Webkit Sunspider uses an expensive JavaScript loop to approximate sine and cosine. Real world sites would actually use the much faster and CPU-optimized functions already available in JavaScript engines.
These optimizations are relatively new to the world of JavaScript runtimes even though there are many examples of dead code in real-world JavaScript on the Web. These optimizations often require significant flow analysis of the code, and in a real world site, spending too much time analyzing code can reduce the responsiveness of the page. The Chakra engine picks the right balance between code quality and analysis time, and only performs a small set of dead code optimizations. We continue to tune this for IE9, and bugs reported via Microsoft Connect are examples of where the optimization could do more. We continue to tune these and other optimizations for the final release.
This kind of dead code elimination is one of many optimizations that Chakra makes to reduce unnecessary work. Over the next few days we’ll post about some of the other techniques Chakra uses to deliver great performance.