Performance Improvements in Internet Explorer 8 Beta 2 Great performance is one of many things being delivered in Internet Explorer 8 Beta 2, the latest version of the popular browser. Beyond a much faster JScript engine, Internet Explorer 8 Beta 2 includes profound performance improvements and exciting new developer features that make it one of the most exciting browser releases in years. Internet Explorer 8 Beta 2 streamlines the browsing experience and ensures that users and developers can be more productive than in any other browser. Find out why the community is buzzing as I highlight some of the most significant performance improvements and great new features being released as part of Internet Explorer 8 Beta 2. Faster JScript As Shreesh Dubey discusses in the article “AJAX Performance Measurement Methodology”, the JScript engine is an important component affecting the speed of the AJAX pipeline used in many websites today. Internet Explorer 8 Beta 2 includes several enhancements that significantly improve those sites. We have worked hard in several broad areas to make sites faster and to reduce the amount of memory Internet Explorer 8 Beta 2 needs on your favorite sites. I describe a few of them below. Circular Memory Leak Mitigation A key factor influencing the performance of Web browsers today is their ability to minimize the amount of memory they require. We have made significant improvements to how the JScript engine manages memory in Internet Explorer 8 Beta 2. | " | Internet Explorer 8 Beta 2 streamlines the browsing experience and ensures that users and developers can be more productive than in any other browser.
| " |
The JScript garbage collector in previous versions of Internet Explorer manages the lifetime of JScript objects but not of DOM objects. As a result, the JScript garbage collector cannot break circular references between DOM objects and JScript objects, and memory leaks can result. In Internet Explorer 6, these circular references are broken when the Internet Explorer process terminates. In Internet Explorer 7, these circular references are broken when users navigate away from page that contains the leaks. Here are four simplified examples of patterns that would leak memory in previous versions of Internet Explorer: Direct Circular References The DOM object refers to itself and an object not in the tree: function leaktest1() { var elem1 = document.createElement("DIV"); elem1.thing = elem1; }
Circular references between DOM objects not in tree: function leaktest2() { var elem1 = document.createElement("DIV"); var elem2 = document.createElement("DIV"); elem1.thing = elem2; elem2.item = elem1; }
Circular References Created by Closures Closures with element created dynamically: function leak3() { var elem = document.createElement("DIV"); elem.onload = function () { var y = elem; } }
Leaks caused by function pointers: function leak4() { var elem = document.createElement("DIV"); elem.thing = elem.setAttribute; }
In Internet Explorer 8 Beta 2, the JScript garbage collector treats DOM objects referenced by JScript objects as any other JScript object. Rather than wait until page navigation as in Internet Explorer 7 or process termination as in Internet Explorer 6, the garbage collector manages the lifetime of these DOM objects, and breaks circular references whenever possible throughout the lifetime of the site. JScript Runtime Improvements In addition to eliminating many sources of circular reference memory leaks, the Internet Explorer 8 Beta 2 JScript engine bakes in impressive optimizations to directly improve scripting speed. Optimized String Operations One of the most common JScript operations in use today is the concatenation of strings. Performance of string concatenation has significantly improved over previous versions of Internet Explorer. In some cases these changes have improved the speed of the + and += operators (as well as the built-in String.concat method) by several orders of magnitude. Coupled with further improvements to other string methods, these enhancements should significantly improve methods that use string concatenation, and obviate the need for developers to devise complex alternative solutions. Optimized Array Operations In addition to the great work to improve string operations, array storage and access within the JScript engine has resulted in order-of-magnitude performance gains for many built-in array methods. JScript authors implementing their own array methods (such as Array.push and Array.pop) as a faster replacement for the built-in array methods should consider using the built-in methods to improve code performance. Optimized Execution Engine Apart from optimizations to strings and array operations, the JScript execution engine shipped within Internet Explorer 8 Beta 2 also optimizes and improves the performance of function calls, object creation, accessing object prototype properties and specific lookup patterns for JScript variables scoped to the window or this objects. The improvements to the Internet Explorer 8 Beta 2 scripting engine combine to improve pure JScript performance by 400% on the SunSpider benchmarking suite and speed up Google Gmail by over 30% compared to Internet Explorer 7. What this means for users is that they will have a faster and more reliable browsing experience on their favorite sites. Developers, in turn, can once again create great new content without having to expend effort managing object lifetime. Unblocked Downloads Beyond improvements to the Internet Explorer 8 Beta 2 scripting engine, another important aspect of site performance is the ability to quickly download page elements. When navigating to a Web page, Internet Explorer typically attempts to parallelize the download of page elements. In the case where Internet Explorer encounters an external script to download, however, previous browser versions would block parallel downloads until the script download was complete. This approach was sensible when bandwidth was constrained, processing power was expensive, and sites were simple. Since the scripts being downloaded could alter the makeup of the page (and thus determine what should be downloaded) this approach could save valuable processing power that would otherwise be wasted. With CPU cycles relatively cheap and broadband widely available, with Internet Explorer 8 Beta 2 Microsoft recognized an opportunity to speed up browsing by taking advantage of these resources. As a result, Internet Explorer 8 Beta 2 no longer blocks parallel downloads in the presence of external scripts. What this means is that Internet Explorer 8 Beta 2 can more efficiently use available bandwidth to make sites faster for users like you and me. This is especially true as sites become increasingly complex. Even better, developers do not need to change their sites whatsoever to take advantage of this improvement. Faster Startup and Navigation In addition to the vast improvements to the JScript engine and the improved parallel download behavior, Internet Explorer 8 Beta 2 features numerous enhancements to reduce the amount of time it takes to start the browser and to navigate to your favorite sites. That work has involved streamlining the Safety Filter, which now keeps users safe at minimal cost. Microsoft has also worked hard to reduce memory fragmentation throughout the browser, significantly reduced registry accesses by up to 25% when navigating to some sites, and streamlined aspects of the Internet Explorer user interface. These changes and others have contributed to a much faster Internet Explorer. |