четверг, 8 марта 2012 г.

Internet Explorer 9 Network Performance Improvements

The browser’s networking subsystem is a crucial component for delivering a high-performance Web experience. In today’s post, I’ll demonstrate this using some real-world measurements, showing that even in a “fast” network environment, the network time dominates the time spent in other subsystems that affect page load time. Next, I’ll provide a brief tutorial of how Web browsers use the network, and outline the improvements we’ve made in Internet Explorer 9 to help ensure speedy page loads.

Real-world Browser Performance and Networking

Last year, we analyzed top sites to measure how much of the overall page load time was related to time spent retrieving content from servers. We ran the tests in what we consider a “fast” environment, on an Intel Core2 2.4ghz running on an 802.11N network connected to a 20MB/sec cable modem. For each iteration of each site, we took 4 measurements of page-load-time (from about:blank to top-level document complete) measuring both PLT1 (clear cache) and PLT2 (primed cache) in “real world” conditions and in an “ideal” world in which network time was zero’d by returning all resources instantly from a proxy located on the local computer.
The results from six representative sites are shown in the following set of charts, one for each site tested. Each ring represents the ratio of “non-network” time (red) to “network” time (blue). The outer rings represent the ratio for the first page load ("clear cache”) while the inner ring represents the ratio for the second visit (“primed cache”).
Chart of six Web sites showing their network vs. non-network load times
As you can see, there’s a wide range of network performance ratios. For sites that make good use of caching (e.g. those in the third column), very little time is spent on the network for PLT2 because the vast majority of content is cached locally in the browser cache. For other sites, while the overall load time in PLT2 is much faster than PLT1, network time still represents the biggest component of page load time because even a single network request takes a relatively long time.
These findings show that even in a “fast” network environment, the network time dominates the page load time. On the initial page load, downloads account for 73% of the time needed to load the page; on a subsequent reload, 63% of the page load time is spent waiting for resources.
Chart showing overall network vs. non-network load times
Stated another way, this set of sites initially loaded in a total of 17 seconds, which would be reduced to 4.6 seconds if not for download time. On reload, the sites loaded in 6.7 seconds, which would be reduced to 2.5 seconds without download time.
Now that we’ve looked at the “real world” impact of network performance, let’s examine the sources of network delay.

Browser Networking 101: Where the bottlenecks are

Every time your browser loads a Web site, an intricate set of steps occurs behind the scenes. A brief summary of these steps follows:
If your computer is not running behind a Web proxy, then your browser uses the network to perform a DNS lookup to convert the hostname you’ve typed (e.g. www.microsoft.com) into the network address (e.g. 65.55.12.249). The browser must then establish a TCP/IP network connection to the target address.
If your computer is running behind a Web proxy, your browser must first locate the proxy. The proxy might be specified directly within your browser settings, or located via a process called Web Proxy Auto-Discovery Protocol (WPAD). After the hostname of the proxy is determined, the browser uses a DNS lookup to convert the proxy hostname to a network address. The browser then establishes a network connection to the proxy server.
If the URL calls for a secure connection (HTTPS) then a SSL or TLS handshake must take place, and the certificates from the server must be verified. This can result in one or more additional network requests to Certificate Authorities (called “Revocation checks”) to ensure that none of the certificates in the chain have been revoked.
After the connection has been successfully established, the browser must send a HTTP request to the server. The server, upon receiving the request must load (or generate) the requested file and begin transmitting it to the client. If the document is a HTML file, it will typically contain references to other resources (e.g. images, script, stylesheets) that must also be loaded in order to fully display the Web page. For each resource referenced by the page, the browser must typically repeat many of the previous steps in order to download the resource needed.
Many of these operations must be performed serially (for instance, you cannot establish a TCP/IP connection without first obtaining the IP address using a DNS lookup) and hence delays in any one operation can dramatically increase the load time of the page.
In some cases, operations can be parallelized or caches can be introduced to reduce the risk of delay. Internet Explorer 9 makes use of both techniques for enhanced performance, as I’ll explain in the remainder of this post.

Faster Networking through DNS Pre-resolution

The Domain Name System (DNS) allows the client browser to convert a hostname into a network address. This process may take between a few milliseconds to several seconds; one recent study pegged the US Median at approximately 150ms, although there is wide variance. Because the browser can only begin establishing a network connection after determining the remote address, DNS is the first bottleneck in network performance.
Internet Explorer 9 includes three optimizations for improved DNS performance; all of these optimizations are based on the fact that multiple DNS requests may be issued in parallel.

Address Bar DNS Pre-resolution

After the third character you type into the address bar, Internet Explorer will issue DNS resolutions for the top 5 hostnames in the dropdown. The results of these resolutions will be stored in the local operating system cache for quick reuse in the future. In this way, if you subsequently navigate to one of these top matches, the browser will have a small head start and will spend less time waiting for DNS results to be returned.

Speculative Pre-resolution for Visited Sites

When you visit a page, Internet Explorer 9 will annotate the page’s history entry with the list of hostnames that were contacted to download content used by the page.
For instance, when loading the IEBlog, the HTML references resources from five other sites (i.msdn.microsoft.com, cdn-smooth.ms-studiosmedia.com, go.microsoft.com, ieblog.members.winisp.net, and silverlight.dlservice.microsoft.com).
Internet Explorer 9 stores these five hostnames in the history entry for the IEBlog site. If you begin to navigate to the IEBlog in a future browser session, Internet Explorer will immediately issue DNS resolutions requests for these five stored hostnames, in parallel with establishment of a connection to the blogs.msdn.com server. This helps ensure that when the blog’s HTML is subsequently returned from the server, the local DNS cache will typically already contain the network addresses needed to download the page’s embedded resources.

Page-initiated Pre-resolution

Internet Explorer will also resolve any hostnames for resolution that are specified by the Web developer in a LINK REL=PREFETCH element. For instance, with the following markup:
...Internet Explorer will kick off a DNS resolution for www.example.com. That way, if a connection is later made to www.example.com, the DNS resolution will have already occurred and the browser can immediately connect to the server without pausing to look up its address.

Faster Networking through Proxy Improvements

Many corporate users are configured to browse the Web using proxy servers, and proxies can have a network performance impact. To that end, we’ve made two key changes to improve performance in an environment that requires a proxy.
First, Internet Explorer has moved its proxy determination logic from the tab processes to the single unified frame process. This helps ensure that when the Web Proxy Auto-Discovery (WPAD) feature runs (and it may take from tens of milliseconds to multiple seconds) it only does so once per browser session, no matter how many browser tabs you open. This also saves some CPU time and nearly 500kb of memory per tab process. The proxy determination improvement can significantly improve the performance of starting a new browser tab and loading a site into it.
Second, Internet Explorer 9 increases the connections-per-proxy limit to 12. This allows the browser to perform more downloads in parallel as compared to IE8, which enforced a six connection limit when using a Web proxy. While the browser’s connections-per-host limit remains 6, many sites use resources from multiple domains and thus benefit from the higher connections-per-proxy limit.

Faster Networking through Parallelism

As mentioned in the DNS Pre-resolution section, doing more work in parallel is a great way to improve overall performance. Some of the browser’s network operations are not inherently sequential and time can be saved by doing work in multiple threads simultaneously.
For instance, we noticed that virtually all sites end up using more than one HTTP connection per hostname, and time could be saved if we open a second “background” connection when establishing the first connection. This background connection is available for the next HTTP request without forcing it to wait for the original connection to become available, and without the delay of opening a new connection in a “just in time” manner. Only one background connection is opened per host, and this improvement can save tens to hundreds of milliseconds when loading a page.
Next, we noticed that in some cases we had a blocking behavior in our connection handling, whereby there were multiple (e.g. 3) open connections to a server, but opening another connection to the server (#4) was delayed until a prior request had completed, even though the connections-per-host limit of 6 meant that we could open a new connection right away. We’ve removed that blocking behavior and allowed more work to finish in parallel.
Lastly, we observed that we could allow the browser to get download requests for images out onto the network more quickly by enabling the lookahead downloader to kick off image file downloads. In support of the HTML5 specification, we also tweaked the image download code to prevent images with an empty source (e.g. ) from making a network request.

Faster Networking through Cache Enhancements

Of course, the most effective way to ensure great network performance is to eliminate network time entirely. The Temporary Internet Files cache allows IE to reuse previously downloaded content without re-downloading the content over the network. Last summer, I summarized a number of caching-related improvements in IE9 that help the browser make better use of the cache. Today, I’ll build upon that post by explaining the other work we’ve done to enhance the functionality of the cache.

Cache Size

Internet Explorer 6, 7, and 8 limit the Web content cache size to 1/32 of the disk capacity by default; in IE7 and IE8, the default capacity value is capped 50 megabytes. Virtually all hard disks in use today are larger than 1.6 gigabytes, which means that nearly all users of IE7 and IE8 are browsing with a content cache limited to 50mb.
Internet Explorer 7’s default 50mb cache size was introduced because analysis in the Windows Vista timeframe showed that the browser’s cache-hit ratio was not significantly improved with caches larger than that size. Beyond consuming more disk space, larger caches can take longer to enumerate and clear (for instance, when performing the Delete Browser History operation). Therefore, an important design strategy is to only increase the cache size when an improved hit rate will result.
In IE9, we took a much closer look at our cache behaviors to better understand our surprising finding that larger caches were rarely improving our hit rate. We found a number of functional problems related to what IE treats as cacheable and how the cache cleanup algorithm works. After fixing these issues, we found larger cache sizes were again resulting in better hit rates, and as a result, we’ve changed our default cache size algorithm to provide a larger default cache.
Internet Explorer 9 has a default cache size limit of 1/256th of the total disk capacity, with a cap on the default to 250 megabytes. The new ratio was chosen to help ensure that low-end netbooks with tiny solid state disks are not impacted by (relatively) huge caches, while desktops with large disks will default to a 500% larger cache vs. IE8. A disk as small as 16gb will result in increase in the default cache size between IE8 (50mb) and IE9 (64mb). Any disk larger than 64gb will reach the default cap of 250mb. In all versions of Internet Explorer, you may manually adjust the cache size limit (within the range of 8mb to 1gb) using the Tools > Internet Options > General > Browsing History Settings dialog box.
If your Temporary Internet Files are stored on a high capacity disk drive with plenty of free space, you may be wondering if you would benefit from configuring an even larger cache. It is definitely possible, but our analysis suggests that increasing the limit above 250mb only results in benefits for some browsing patterns. Importantly, the caching system is internally limited to storing approximately 60,000 objects. Depending on the size of your cache and the size of the resources you download, you may encounter the object count limit before encounter the size limit.
Technical Note: Internet Explorer maintains two caches, one for content used in Protected Mode (Internet and Restricted Zones) and one for content used outside of Protected Mode (Intranet, Trusted, and Local Computer zones). Each cache is individually capped at the limit, so the aggregate maximum disk space consumed by caches is double the individual limit.

Cache Cleanup

As mentioned in the previous section, our analysis of the cache cleanup algorithms used in IE8 and below indicated significant room for improvement. As a result of that analysis, we’ve substantially rewritten the cache scavenger (which removes low value entries to free up cache space) for Internet Explorer 9. The new scavenger is significantly more likely to retain valuable entries (those cache entries which are likely to be used again) by discarding less valuable entries.
Internet Explorer’s cache scavenger is kicked off as the cache limit (size or object count) is approached. Its goal is to remove the least valuable 10% (by size) of the objects in the cache. It does this by enumerating the objects in the cache. In the first pass, it assigns each a score between 0 and 66,000. In the second pass, it deletes the entries which are ranked in the lowest 10% of the scores.
In IE9, we’ve made significant changes to how the scores are calculated to better ensure that the most valuable entries are kept and the least valuable entries are discarded.
Of the 66,000 possible points, 40,000 points are determined by how recently a given resource was used. 20,000 points derive from how often the resource has been used, and 6000 points derive from the presence of validator information (HTTP response headers like Last-Modified and ETag) that allow conditional revalidation of resources after their freshness period expires.
We also take the MIME type of the resource into account; script, CSS, and HTML/XHTML resources receive full credit, while other resource types (e.g. images, audio, etc) receive only half of their allocated points. This helps ensure that the resources which have the greatest impact on page load time survive in the cache longer than lower priority resources.
Cache entries that have been used more than once receive an increasing number of reuse points; to get more than 10,000 points, the resource must have been reused over a period longer than 12 hours. This helps prevent resources that were reused frequently but only within a short period (e.g. when you’re browsing around a site you rarely visit) from getting the same amount of credit as a resource that is reused frequently across a long period (e.g. a script on a site that you visit every day).
Entries which have validators collect validator points, but the biggest impact of validators occurs after resources are no longer fresh. Any resources which have expired and do not contain validators receive a score of 0 points (since they cannot be reused nor revalidated), while those with validators retain 70% of their score. Expired resources with validators retain most of their score because they allow the browser to quickly recheck the freshness of a cached resource-- the server may reply with a small HTTP/304 response (with no body) indicating that the cached copy may be reused.
The scavenger is also sensitive to a number of special cases—for instance, no resource will be scavenged for the first 10 minutes after it was downloaded, and resources that exceed the cache size (e.g. downloading a 4gb ISO file) are temporarily exempted from scavenging to permit the download to successfully complete.

Faster Networking through Content Filtering

Internet Explorer 9 also includes new Tracking Protection and ActiveX Filtering features. Both of these features can improve your overall browser performance by preventing download and execution of undesired content. For instance, when loading the homepage of one popular news site, enabling the ActiveX Filter and one popular Tracking Protection list results in a significantly faster page load:

HTTP Request Count Bytes Sent Bytes Received Page load time
Filtering Disabled 168 98.5k 1.9M 7.5s
Filtering Enabled 138 71.7k 1.6M 3.6s
The page load time is improved by more than 50% because the browser is able to avoid downloading and running content which is not critical to the display of the page.

Conclusions

As you can see, we’ve taken a very broad approach to improving Internet Explorer’s network performance, in support of our engineering goal of building the world’s fastest browser. Of course, the speed of your own network connection remains an important factor in the equation, and Web developers should continue to follow best practices for performance, but IE9’s investment in network performance helps us deliver a significantly faster page load time across a wide variety of pages.
—Eric Lawrence

Preparing Your Site for IE9

As we have blogged about many times, one of our top goals for IE9 is enabling developers to utilize the same markup and code (HTML, CSS, and JavaScript) across all modern browsers. Part of enabling the same markup means changing existing Web platform behavior for standards-compliance and interoperability. We have published and updated the list of changes to the platform in the IE9 Guide for Developers along with platform previews so that developers have an opportunity to try new features and test early and often.
We carefully designed and implemented new platform features to ensure existing sites continue to run well in IE9’s Standards mode. As a result, for many Web developers, no additional work is required to prepare for IE9.
For sites that need to update, we have identified a set of changes more likely to impact existing code that does not use feature and behavior detection. These changes are documented in the IE9 Compatibility Cookbook, which we will continue to update based on your feedback. For your convenience, we have listed the changes with a higher probability of impact below. Refer to the IE9 Compatibility Cookbook for in-depth information on these changes.

Differences between IE9 and IE8 Standards modes

Differences in IE9’s platform behavior from IE8 across all document modes

Another important goal for IE9 is ensuring that legacy document modes continue to behave the same as they did in previous versions of IE. The only exceptions we make are to improve overall product quality in areas such as security.
If you are updating your site from IE7 mode, you may also want to look at Tony’s Site Compatibility and IE8 post.

Help Us Help You

If you think we’re missing a compatibility topic or one needs additional information, please contribute through the IE9 Compatibility Cookbook site.
—Tony Ross and Marc Silbey, Program Managers, Internet Explorer

A Web Standard Quickly: W3C Navigation Timing reaches Candidate Recommendation

Sometimes Web standards can converge quickly. The W3C standard for Navigation Timing started about six months ago in the newly chartered Web Performance Working Group. The working group’s objective is to provide interoperable features that enable developers to measure and improve performance of their Web applications.
Navigation Timing is the first specification from this this W3C working group, and in only six months went from a Working Draft to Candidate Recommendation. The community and representatives of Microsoft, Google, Mozilla, Opera, and Facebook worked together in an agile way to deliver a standard that works in IE9 and Chrome and will likely come to other browsers soon.

Is this standard “Ready and Done”?

The status Candidate Recommendation (CR) means that there is consensus agreement among participants at the W3C that the standard is “is stable and appropriate for implementation.” The W3C Directors can then call for implementations. The next step after the call for implementations is Proposed Recommendation, the final endorsement by the W3C.
Internet Explorer 9 Release Candidate and Chrome 10 Beta both offer vendor-neutral implementations of Navigation Timing. This means that Navigation Timing is an interoperable API and is ready for use by Web-developers today. The third IE9 Platform Preview was the first implementation of Navigation Timing, and IE9 was the first full browser to implement the specification with a vendor prefix. While transitioning from Last Call to Candidate Recommendation in the W3C, IE9 and Chrome removed the prefix. Now, Web-developers have access to performance information about their Web sites in an interoperable way.

For Developers and Privacy Enthusiasts

In the Release Candidate build of Internet Explorer 9, we removed the vendor prefix and moved towards the namespace window.performance. Underneath the performance namespace you’ll find two interfaces, navigation and timing. Navigation focuses on describing the type of browsing and browsing activity such as the number of server-side redirections that occurred while retrieving the root document, while the timing interface contains the time taken to fetch and load the root document.
To protect consumers from malicious sites, Internet Explorer 9 follows the specification and zeros out the timings for third-party sites that an attacker may attempt to use to determine your browsing history. Analyzing which third-party sites have a faster cross-site access time could reveal cache information.

What’s Ahead

With two implementations available, moving towards Proposed Recommendation should not take very long. You can see the Navigation Timing interface in action on the IE9 Test Drive. Submit your feedback so the working group can make sure we have designed and implemented an interface that meets your needs.
Special thanks go to Arvind Jain, Steve Souders, Zhiheng Wang, James Simonsen, and Tony Gentilcore from Google, Jonas Sicking from Mozilla, Sigbjørn Vik from Opera, and Jason Sobel from Facebook for their contributions to this work.
The working group has now turned our attention toward Resource Timing and User Timing, capabilities that enable developers to measure the performance of individual site resources and script. We expect these specifications to follow a similar implementation path over the next year.
—Jason Weber, Performance Lead, Internet Explorer

User Experiences: An Insight into Our Design Process

We wrote about the critical role your feedback plays in helping us refine Internet Explorer. We also described some of the user experience changes in IE9 Release Candidate that were inspired by that feedback. With this post, we provide a deeper insight into our design process by looking at a tab pinning improvement we shipped in the IE9 Release Candidate.

Pin Sites via Tab Drag

The ability to pin a site is a new feature in IE9. People can get quick access to their sites in IE9 by pinning them to the taskbar, just like they pin applications. To provide an even stronger focus on a pinned site, IE9 frame assumes site’s branding. Additionally, Web site developers can improve common tasks specific to their pinned sites by programming jump lists and notifications.
When evaluating pinned sites early on in our usability studies, we noticed that people often expect to be able to pin a site by dragging its tab to the taskbar. For an action that is as “physical” as site pinning, reaching for the most interactive representation of the site in the frame, the tab, made sense. So, in addition to enabling people to pin a site by dragging its favicon to the taskbar, we enabled site pinning via tab drag in Beta.

The Problem – Disambiguate User Intent

However, our Beta build enabled tab pinning only when the taskbar was at the bottom of the screen. Trying to pin a tab to the taskbar at the top or sides of the screen resulted in window snapping to the screen edge. You noticed that this functionality was missing and this was one of the most frequently reported Beta issues.
Knowing that this was one of the top Beta issues that you reported was particularly interesting in the light of the fact that only about 2% of people who use Windows have their taskbar at a non-default, bottom location. For us, that discrepancy provided yet another reminder that a lot of people who install pre-release builds are remarkably enthusiastic about technology and IE; they often take the time to customize their software and frequently use it in ways that deviate from how majority of people use it. Even though pinning sites was possible via favicon drag and although we knew that majority of people would never hit this issue, we worked on solving it with the same zeal and attention to detail as on user experience issues with broader impact.
The biggest challenge in solving the problem came from the fact that there are several reasons that can motivate a person to drag a tab:
  • Move the tab within the IE window, changing its location with respect to other open tabs,
  • Drag it to a different or a new IE window,
  • Use Windows 7 Aero Snap feature to snap the tab to the screen edge,
  • Pin a site.
Interpreting the user intent incorrectly in any of these cases would result in an undesirable outcome.

The Goal – Enable Both Tab Pinning and Tab Aero Snap When Taskbar is on Top/Sides

The 1st and 2nd tasks listed above don’t require dragging the tab to the taskbar and we could remove those tasks from consideration. So, we were left with a problem that required reconciling tab Aero Snap and site pinning – when a tab is being dragged over the taskbar, is the person trying to pin the tab to the taskbar or snap the tab to the screen edge?
Since Aero Snap doesn’t allow window snapping to the bottom of the screen, there is no dichotomy when the taskbar is at the bottom – in that case, tab pinning is the only thing that a person can do. And, when it comes to the cases when the taskbar is at the top or on the sides, we knew that always choosing one of the two options wouldn’t always work for all the people, as illustrated in the aforementioned Beta feedback we received. Therefore, our goal was to find a solution that enables both, tab pinning and snapping the tab when taskbar is on the sides or at the top.

Iteration – Top Options

After several rounds of brainstorming and rough sketching, we decided to create medium-fidelity interactive prototypes for two most promising options:
  1. In the 1st option, as soon as the person started dragging a tab, we would show target UI adjacent to the taskbar. Dragging the tab onto the target UI would pin it; dragging it to any other taskbar surface would snap the tab to the window edge.
  2. In the 2nd prototype, we enabled the person to use a single motion to alternate between pinning and tab snapping. Dragging the tab onto any point within the taskbar would enable the person to pin the tab first:
    Screen shot showing pinning a site to a taskbar on the left side of the screen
    If the person didn’t want to pin the tab, she could just drag the tab away and back over the taskbar again without releasing the mouse. At that point, the window would snap to the edge.
    This solution intentionally favored tab pinning over tab Aero Snap since we anticipated that tab pinning would be more frequent of the two actions, under the premise that people would drag the entire window (and not a specific tab) when wanting to snap it to an edge.

The Solution – Single, Continuous Motion

We analyzed the pros and cons of both ideas. We also shared these two prototypes with Microsoft employees who weren’t directly involved with the problem space, looking for quick feedback on desirability of each.
After analyzing the different design proposals and measuring them against the two key scenarios (pinning and tab Aero Snap), we decided to pursue the 2nd option for few reasons:
  • It was more flexible than the 1st one. In it, the pinned site could go exactly where the person wanted it to show up on the taskbar. Contrarily, with the 1st design, the target UI was always showing up in the same taskbar location (at the end of list of taskbar applications) and the person was forced to pin her site at that location.
  • It was less “loud” and more in line with our overarching goal of highlighting Web content and not focusing on the application itself. There was no additional UI, no new concepts to learn, no target UI showing up when people moved tabs for reasons other than wanting to pin them to the taskbar. Simply, it “just worked.”
  • It was more fluid. Through a single, continuous action, the person was enabled to both pin and snap the tab to an edge.
We hope you enjoy being able to pin your tabs to the taskbar in the Release Candidate build of IE, even if your taskbar is not at the bottom of the screen. We also hope you enjoyed reading about how we went from a realization that there is an opportunity to improve the user experience to actually designing the change that shipped to millions of people.
Thanks for your continuous support and for your help in making IE9 great.
—Mirko Mandic, Program Manager, Internet Explorer

SmartScreen® Application Reputation – Building Reputation

With the Internet Explorer 9 (IE9) beta in September we introduced IE9's new application reputation feature and more recently we provided a summary of how this fits into the overall layered approach to security. With the final release of IE9 now available, we want to share some additional information about application reputation, clarify how code signing impacts the IE experience, and reiterate industry best practices that application developers should consider.
SmartScreen Application Reputation is a consumer focused safety feature that helps consumers make better decisions about the programs they download. Downloads are automatically assigned a reputation rating based on multiple algorithms that consider many objective criteria, such as antivirus results, download traffic, download history, and URL reputation. If a user opts into enabling the SmartScreen Filter, application downloads without established reputation result in a notification (see below) warning them that the file may be a risk to their computer.
From this notification, users can choose to delete the file or ignore the warning and run the downloaded program. For the typical user, the risk of running the download is a 25% to 40% chance of malware infection. We've been building reputation for some time now and approximately 90% of all application downloads have established reputation by hash or digital certificate. For the typical user, this notification is an infrequent experience associated with higher risk of malware infection. To put the scale of this risk in perspective, approximately 7% of all executable files downloaded by Internet Explorer are later confirmed as malicious. A portion of these attacks are prevented by blocklist solutions such as SmartScreen URL reputation or antivirus products. Unfortunately, no blocklist-based solution is 100% effective at preventing these attacks. Since Application Reputation was enabled in the IE9 beta release, the feature has greatly reduced infection rates from attacks that were not otherwise detected at the time of download.
Unsigned Download – IE9 Application Reputation Notification
Screen shot of the IE9 application reputation notification with an unsigned download.
Signed Download – IE9 Application Reputation Notification
Screen shot of the IE9 application reputation notification with a signed download.

How programs are identified in IE9

A download’s Application Reputation is assigned by:
  • a hash of the downloaded file
  • the digital certificate used to sign the file (if signed)
The file hash is an exact identifier for the specific file downloaded. If any part of the application changes, the program identity (file hash) will also change. An unsigned application that is updated regularly (e.g. unsigned daily builds) will appear as multiple distinct programs that will have to build reputation individually.
Reputation is also generated for digitally signed downloads based on the digital certificate used to sign the file. Digital certificates allow reputation to be assigned to a single identity (digital certificate) across multiple files. If you are not signing your programs, reputation will be built independently for each file you distribute. In contrast, signed programs may inherit the reputation of your digital certificate.

Why Sign Your Code?

For developers distributing applications online, signing your code is not required to establish reputation, but it is highly recommended. Code signing is an industry best practice that allows consumers to authenticate that files signed by a publisher are actually from that publisher. Signing also helps ensure that files cannot be secretly tampered with while stored on a server or during the download process. Without a digital signature, there is no way for a user to validate who actually created the file. This threat is commonly exploited by malware authors in their social engineering attacks.
Of course, the presence of a digital signature alone does not ensure a download is non-malicious. Digitally signing your application is not a guarantee that your download will have established reputation immediately, but can play an important part in ensuring that your applications receive the reputation they deserve.
Note that even if SmartScreen® Filter is disabled, users will be warned before unsigned applications are run:
Internet Explorer 9 – Unsigned File Notification
Screen shot of the IE9 notification of an unsigned download when SmartScreen filtering is disabled.

Best Practices for Application Developers

There are several industry best practices an application developer can follow to help establish and maintain reputation for your applications:
  • Digitally sign your programs with an Authenticode signature.
    • Obtain a valid Authenticode code signing certificate from one of the many certificate authorities (CAs) supported by Windows.
    • Use development tools (such as signtool.exe) to sign your applications prior to distribution.
    • For more detailed information and a step-by-step description of the code signing process, see Eric Lawrence's excellent post Everything you need to know about Authenticode Code Signing.
  • Ensure downloads are not detected as malware. Downloaded programs that are detected and confirmed as malware will affect both the download’s reputation and the reputation of the digital certificate used to sign that file.
  • Apply for a Windows Logo. To learn more about the Windows Logo visit the Windows 7 Logo Program page on MSDN.
More information about digital signatures and code signing:
Thanks for your help in ensuring a safer, more streamlined download experience for consumers.
—Ryan Colvin, Program Manager, SmartScreen

Updates to Add-on Performance Advisor

The Add-on Performance Advisor helps you stay in control of your browsing experience with add-ons. Since we introduced this feature in IE9 Beta, the positive and constructive feedback you provided enabled us to adjust the functionality while maintaining its original goals. You can experience these changes in action with the final release of IE9.
In this post, we review the issues users face today with add-on performance and the benefits offered with this feature. We describe the rationale behind the key changes we made and show how they improve the user experience and more accurately measure add-on performance. Along the way, we address some frequently asked questions on the feature’s functionality.

Recap: Add-ons and Performance

Add-ons can have a material impact on browsing performance, most notably in the following activities:
  • Opening a New Tab
    Every time you open a new tab or browsing window, IE initializes your add-ons. The time it takes each add-on to initialize is its load time.
  • Navigating to Web pages
    Every time you visit a Web page, your add-ons can perform operations on the page, such as adding icons next to search results or scanning links to identify phishing sites. The time it takes an add-on to perform these operations for each navigate is its navigation time.
Many users have multiple add-ons installed and running in their browsers. The cumulative performance impact of all these add-ons affects the overall experience of browsing and viewing a Web site.
While we work with add-on developers to improve add-on performance, it’s important for you to understand add-ons’ performance impact and how to manage them. The Add-on Performance Advisor monitors add-on performance and notifies you only when your add-ons are noticeably slowing down your browsing experience. You can choose to use only the add-ons you want while maintaining browsing performance.

Accurately Measuring Add-on Performance

We made two changes to our add-on performance measurement algorithms since IE9 Beta:
  • IE no longer records the first load time for all add-ons after upgrading to IE9
  • IE no longer records an add-on’s first load time after it is installed and enabled for use in IE9
Here’s a brief explanation of the change. While analyzing the load times for 15 of the most popular add-ons in IE8 we found that the average add-on load time in the above two scenarios were notably higher than the average load time during regular browsing:
Load Time Measurement Scenario Average Load Time (milliseconds)
Launch IE9 regularly 37
IE9 first run after upgrade 399
Add-on first run after it is enabled in IE9 300
This difference in load time exists because add-ons typically perform more operations when launched for the first time. Additionally, since IE takes longer to launch for the first time, it shares system resources with add-ons and will increase add-on load times.
It’s important that we measure an add-on’s load time accurately and consistently so that you can make the right decisions on your add-ons. We decided not to record load times in the above two scenarios with this goal in mind.
For example, in IE9 Beta you may prematurely disable an add-on that you like because its first load time is notably higher and triggers the Add-on Performance notification. With the current functionality, we will show the Add-on Performance notification only if we continue to measure high load times for that add-on.

Evolving Notifications

We received lots of good feedback regarding the design of the Add-on Performance notification since Beta. We’ve since refined the design for the final IE9 release:
Screen shot of notification bar asking to speed up browsing by disabling add-ons
We updated the notification message and added an option in the dropdown menu for the “Ask me later” button:
Screen shot of "Ask me later" options in notification bar asking to speed up browsing by disabling add-ons
If you are satisfied with your add-on performance even though it is above your desired threshold, you can select the “Don’t disable” option to turn off the Add-on Performance notification for 30 days. If you prefer not to make a decision on your add-ons yet, you can select the “Ask me later” option which only turns off the notification for 1 day.
Once you install and enable a new add-on, IE will turn the Add-on Performance notification back on since the new add-on may impact browsing performance beyond your previously desired levels.
When multiple new add-ons are installed, we made it clearer to users that they can choose which ones to enable:
Screen shot of notification bar indicating there are new add-ons ready for use

Choose Add-ons Dialog

You can launch the Choose Add-ons dialog via both the above notifications. When it’s launched from the Add-on Performance notification, we show the following variation of the dialog:
Screen shot of the Choose Add-ons to disable dialog box
Some of you asked how IE decides which color is used to display the bars in the above dialog. Our intention is to use the colors to indicate the minimum number of add-ons that need to be disabled so that you can stay below the threshold. In the above dialog, disabling the Contoso and Litware toolbars, which have red bars, leaves you with 0.04 seconds of total load time.
You may decide to only use the Contoso Toolbar. If you disable all the other add-ons, we’ll display a grey bar for the Contoso Toolbar indicating that you’re now below the threshold. Similarly, you can change the default threshold to 0.50 seconds and all the above add-ons will have grey bars displayed.
Notice that we lengthened the default height of the above dialog to accommodate 6 add-ons before requiring you to scroll. This helps you make the most informed decision on which add-ons to use since you can view the performance impact of more add-ons at one glance. We also added a confirmation dialog when you press “Disable All” so that you don’t accidentally disable all your add-ons:
Screen shot of confirmation alert shown when disabling all add-ons

Thanks for Your Feedback

The feedback you’ve given us on the Add-on Performance Advisor since IE9 Beta allowed us to improve the overall user experience and add-on performance measurement accuracy.
In a future post, we’ll blog more about add-on performance and how the ecosystem has evolved since we started the conversation around measuring and improving performance. We’ll continue to engage with add-on developers on improving add-on performance through blog posts and other efforts. The ideal experience is one where you can use as many add-ons as you want without compromising browsing performance (and reliability, security, and privacy).
—Herman Ng, Program Manager, Internet Explorer

IE9’s Document Modes and JavaScript

Internet Explorer 9 standards document mode enables the same markup and same script to work across browsers. You should use Internet Explorer 9 standards document mode to take advantage of new features in the ECMAScript, Fifth Edition standard (ES5) and IE9’s enhanced DOM programmability. However, to maintain fidelity with older versions of IE, the JavaScript functionality supported in IE9’s Quirks mode, IE7 standards mode, and IE8 standards mode differs somewhat from IE9 standards mode. You can use these compatibility modes and the F12 developer tools to migrate your site to use the new ES5 features on your own schedule, while your site continues to run in IE9.
In two blog posts – Testing sites with Browser Mode vs. Doc Mode and IE’s Compatibility Features for Site Developers – Marc Silbey explains how to take advantage of document modes in Internet Explorer 9. He also discusses how to use Browser Mode and Document Mode to test sites for IE9 and previous IE versions. In this post, we’ll explore what developers need to know about how the document modes in IE9 affect JavaScript code.

Document Modes and JavaScript Support

As mentioned in a previous post, you (the developer) control the document mode that IE will use when rendering your site by using the DOCTYPE and X-UA-Compatible Meta tag or HTTP Header. Chakra, the new JavaScript engine in IE9, uses the document mode to determine the JavaScript features to support. The table below summarizes Chakra’s JavaScript support under the four IE9 document modes. For information on how to set the document mode, see our post on IE’s Compatibility Features for Site Developers and the Determining Document Mode diagram for IE9.
Document Mode Description
IE9 standards IE9 standards document mode is the default if a Web page uses a standards-compliant DOCTYPE and doesn’t specify an X-UA-Compatible meta tag. In this mode, IE supports ECMAScript, Fifth Edition features, enhanced DOM programmability, and removes some of the key differences between our IE8 JavaScript implementation and the ECMAScript, Third Edition Specification.
IE8 standards IE8 standards document mode supports the JavaScript additions we made in IE8 to implement portions of the then-draft ES5 standard, such as native JSON support and accessor support on DOM objects. This mode also supports the changes made in IE8 to fix some key issues raised by developers.
IE7 standards IE7 standards document mode supports the JavaScript functionality that was available in IE7, including the Microsoft extensions supported in the IE7 standards mode in IE7 and IE8.
Quirks Quirks mode supports the JavaScript functionality of IE6, and the Quirks mode of IE7 and IE8.
Your JavaScript may behave differently in the different document modes. Here are three examples of code that, due to our conformance to the ES5 standard, provide different results depending upon the document mode. For additional compatibility guidance and JavaScript feature changes in IE9, see the Compatibility Cookbook on MSDN, the blog post Enhanced Scripting in IE9: ECMAScript 5 Support and More, the ES3 Standards Support document, and the Microsoft JScript extensions to the ES3 standard.

Arguments.caller

Arguments.caller is not supported in IE9 standards document mode, per ES5 section 10.6. Consequently, Quirks, Internet Explorer 7 standards, and Internet Explorer 8 standards document modes in IE9 alert “1” for the following code. Internet Explorer 9 standards mode issues the script error "Unable to get value of the property 'length': object is null or undefined."
function alertCallerLength() {
    alert(arguments.caller.length); // IE9 standards doc mode issues script error
}

function callingFunction() {
    alertCallerLength();
}

callingFunction(1)

Indirect Eval

The ES5 standard requires that indirect evals—invocations of eval() by using a name other than “eval”—resolve to a global scope rather than a local scope. To support compatibility with previous versions of IE, Quirks, IE7, and IE8 doc modes maintain a local scope for indirect evals, while IE9 standards mode interprets them according to the global scope.
var x = "Global Scope";
var myeval = eval;

function f() {
    var x = "Local Scope";
    alert(myeval("x"));
}

f(); // IE9 doc mode alerts "Global Scope"; other doc modes alert "Local Scope"

String objects

In IE8 and IE9, indexed properties can be added to string objects. With IE8 you can create these properties for all indexes regardless of the length of the string object. In IE9 you can create indexed properties, but only for indexes that are greater than the length of the string. IE9 will also give you indexed access to the string itself. In the example below, we create a String object and then attempt to define values for array indices of that object. IE8 and the IE9 compatibility document modes allow us to create an array object with the same variable name as a string object; IE9 standards mode does not. As a result, in IE9 standards mode, the function returns “H-e-l-l-o- -W-o-r-l-d.” In the other document modes, the function returns “-1----5----9-.”
function JoinDemo(){
    var a = new String("Hello World");
    a[1]="1";
    a[5]="5";
    a[9]="9";
    alert(Array.prototype.join.call(a, "-"));
}

JoinDemo();
// IE9 standards doc mode alerts "H-e-l-l-o- -W-o-r-l-d"
// IE8, IE7, Quirks doc modes alert "-1----5----9-"

Testing JavaScript in Different Document Modes

As you migrate your site to IE9 standards doc mode, you may find that some of your script behaves differently than in Internet Explorer 8. The F12 developer tools in Internet Explorer 9 enable you to test your scripts in the four document modes. Changing the Document Mode through IE’s F12 developer tools refreshes the page and instructs the Chakra JavaScript engine to reparse the script according to the specified document mode. You can use these document modes to help debug your scripts as you migrate your code to IE9 standards mode.
Screen shot of F12 Developer Tools' Document Mode menu

Additional Information

We have made every effort to ensure that IE9’s compatibility document modes support the same functionality that we shipped for these modes in IE8. However, because the Chakra engine is not the same as we shipped in IE8, it is bound to have some differences. The Internet Explorer 9 Compatibility Cookbook explains some of these key differences. Briefly the following are affected:
If you encounter additional compatibility issues, we’d like to hear about them. Please send us your feedback via Connect.
We’d also like to point you to some blog posts and IE Test Drive demos that we have created to explain or showcase the new functionality that Chakra introduces, and some differences from IE8.
In summary, IE9 supports different ECMAScript standards and extensions in different document modes. The new IE9 document mode allows you to take advantage of new ES5 features according to your schedule. We hope you find the F12 developer tools useful as you debug your code and migrate to the ES5 and HTML5 features supported in IE9 document mode.
—Gaurav Seth and Paul Chapman, Program Managers, JavaScript