<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>JScript Blog : JScript Performance IE</title><link>http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx</link><description>Tags: JScript Performance IE</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Native JSON Support in IE8 and Tracking the ECMAScript Fifth Edition Draft Specification</title><link>http://blogs.msdn.com/jscript/archive/2009/06/23/native-json-support-in-ie8-and-tracking-the-ecmascript-fifth-edition-draft-specification.aspx</link><pubDate>Mon, 22 Jun 2009 22:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798184</guid><dc:creator>GauravS</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9798184.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9798184</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9798184</wfw:comment><description>&lt;P&gt;&lt;A href="http://www.microsoft.com/windows/internet-explorer/default.aspx" mce_href="http://www.microsoft.com/windows/internet-explorer/default.aspx"&gt;Internet Explorer 8&lt;/A&gt; was the first browser to introduce native support for encoding and decoding JSON. While we were finalizing the JSON support to be introduced in IE8, the &lt;A href="http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf" mce_href="http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf"&gt;ECMAScript Fifth Edition (ES5) Draft Specification&lt;/A&gt; was still under active development.&lt;/P&gt;
&lt;P&gt;At that time, there were clearly two options in front of us:&lt;/P&gt;
&lt;P&gt;First, to wait till the new specification is approved so that we can ship a fully compliant native JSON feature. This had a big disadvantage of not being able to provide web developers with both – performance and security benefits that native JSON offers over a script implementation of JSON in IE8 (as final approval of the standard was at least a year away).&lt;/P&gt;
&lt;P&gt;Second, providing JSON support in IE8 based upon early drafts of the standard and then, if necessary, bringing the IE JSON support into compliance with the ES5 specification once the standard is ratified (currently expected to happen in Dec’09). This option had the disadvantage that if the specification changed after IE8 shipped there would be a period time during which the IE8 JSON support would have variances from the ES5 specification.&lt;/P&gt;
&lt;P&gt;Weighing the two, we decided to choose the second option as it meant providing web developers the ability to start taking advantage of the native JSON constructs immediately. Moreover, the changes that were expected in the specification were not drastic and could easily be detected and worked around as needed by providing simple wrappers created in JScript itself. &lt;/P&gt;
&lt;P&gt;Both, the candidate draft of the ES5 Specification and IE8 are now available. The list of differences that currently exist between the implementation and the draft specification is provided below with possible workarounds. It is worth noting that additional changes may still be made to the candidate ES5 specification based upon reviewer feedback. What this means is that the final form factor of JSON might be a bit different than the draft or what is covered in this article by the time ES5 is standardized.&lt;/P&gt;
&lt;P&gt;Following is a list of differences between IE8’s behavior and the current ES5 Draft Specification of&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc836459(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc836459(VS.85).aspx"&gt;&lt;B&gt;&lt;FONT size=2 face="Courier New"&gt;JSON.stringify(value[,replacer[,space]])&lt;/FONT&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;&lt;/B&gt; is undefined and is not replaced using a &lt;FONT face="Courier New"&gt;&lt;STRONG&gt;replacer&lt;/STRONG&gt;&lt;/FONT&gt; function, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should return &lt;FONT face="Courier New"&gt;undefined&lt;/FONT&gt; instead of the string &lt;FONT face="Courier New"&gt;"undefined"&lt;/FONT&gt;. &lt;/LI&gt;
&lt;LI&gt;If &lt;FONT face="Courier New"&gt;&lt;B&gt;value&lt;/B&gt; &lt;/FONT&gt;is a function and is not replaced using a &lt;B&gt;&lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt;&lt;/B&gt; function, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should return the value &lt;FONT face="Courier New"&gt;undefined&lt;/FONT&gt; rather than the string &lt;FONT face="Courier New"&gt;"undefined"&lt;/FONT&gt;. &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;&lt;/B&gt; is a Number or String object after the &lt;FONT face="Courier New"&gt;toJSON() &lt;/FONT&gt;method and &lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt; function have been executed on &lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should return the primitive number or string value stored in the Number or String object.&amp;nbsp; &lt;I&gt;Note: Per the latest ES5 &lt;/I&gt;&lt;A href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc" mce_href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc"&gt;&lt;I&gt;errata&lt;/I&gt;&lt;/A&gt;&lt;I&gt; (27 May’09) Boolean objects are also included in this.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;&lt;/B&gt; is a cyclic object or array, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should throw a &lt;FONT face="Courier New"&gt;TypeError&lt;/FONT&gt; and not an &lt;FONT face="Courier New"&gt;Error&lt;/FONT&gt;. &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt;&lt;/B&gt; is not a Function or an Array, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should ignore the &lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt; parameter and not throw an error. &lt;/LI&gt;
&lt;LI&gt;If the &lt;B&gt;&lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt;&lt;/B&gt; function calls a DOM method and passes the &lt;FONT face="Courier New"&gt;key&lt;/FONT&gt; parameter to the same, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should not throw an &lt;FONT face="Courier New"&gt;Error&lt;/FONT&gt;. &lt;I&gt;Note: To work around this issue, use &lt;/I&gt;&lt;I&gt;key.toString()&lt;/I&gt;&lt;I&gt; when passing key to DOM methods like &lt;/I&gt;&lt;I&gt;alert()&lt;/I&gt;&lt;I&gt; and &lt;/I&gt;&lt;I&gt;createElement()&lt;/I&gt;&lt;I&gt; inside the replacer function.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/B&gt; is an empty string, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should default &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; to an empty string instead of newline. &lt;/LI&gt;
&lt;LI&gt;If &lt;STRONG&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/STRONG&gt; is a Number object or a String object, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should use the primitive value of the objects instead of ignoring the same. &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/B&gt; is set to a value greater than 100, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should default &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; to be 100 instead of the current maximum limit of 65535 after which &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; is defaulted to 0. &lt;I&gt;Note: Per the latest ES5 &lt;/I&gt;&lt;A href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc" mce_href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc"&gt;&lt;I&gt;errata&lt;/I&gt;&lt;/A&gt;&lt;I&gt; (27 May’09) the max &lt;/I&gt;&lt;I&gt;space&lt;/I&gt;&lt;I&gt; should be defaulted to 10.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/B&gt; is a non integer numeric value, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should default &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; to be the integer part of the &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; value instead of defaulting it to the ceiling value of the &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; argument. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc836466(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc836466(VS.85).aspx"&gt;&lt;B&gt;&lt;FONT size=2 face="Courier New"&gt;JSON.parse (text[, reviver])&lt;/FONT&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If text contains control characters other than TAB, CR, or LF, throw a Syntax Error. In addition, throw a SyntaxError if TAB, CR, or LF appear in a JSON string literal. IE8 correctly rejects illegal characters outside of string literals. &lt;I&gt;Note: To work around this problem for string literals, user can define a reviver method that looks for string values containing control characters. Given the performance tradeoff to find these characters in all JSON text strings, a generic reviver is not provided in the sample below.&lt;/I&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc907896(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc907896(VS.85).aspx"&gt;&lt;B&gt;&lt;FONT size=2 face="Courier New"&gt;Date.prototype.toJSON (key)&lt;/FONT&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If the Date value is not a finite Number, &lt;FONT face="Courier New"&gt;toJSON&lt;/FONT&gt; should return &lt;FONT face="Courier New"&gt;null&lt;/FONT&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Note that the majority of these differences concerning the handling of invalid argument values or other unusual situations. Most of them have no impact on the encoding or decoding of normal data.&lt;/P&gt;
&lt;P&gt;A workaround for these differences is provided in the following patchJSON function which can be called to suitably modify the built-in JSON support methods, before using any of the JSON built-ins by a user. It places a wrapper around the built-in JSON functions.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; PADDING-TOP: 5px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:59b176b7-810c-4471-8261-646d7aecd7ea class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BACKGROUND: #ddd; MAX-HEIGHT: 500px; OVERFLOW: scroll; PADDING-TOP: 0px"&gt;
&lt;OL style="MARGIN: 0px 0px 0px 45px; BACKGROUND: #ffffff"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt; patchJSON() {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Check if JSON exists, or if&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// JSON has already been patched or updated&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((!&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.JSON) || (JSON.stringify(undefined) !== &lt;SPAN style="COLOR: #a31515"&gt;'undefined'&lt;/SPAN&gt;))&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;//JSON has already been patched or updated;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; builtinStringify = JSON.stringify;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;JSON.stringify = newStringify;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Date.prototype.toJSON returns null for Dates with a non finite value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; origDateToJSON = Date.prototype.toJSON;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((origDateToJSON.toString()) ===&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #a31515"&gt;"\nfunction toJSON() {\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[native code]\n}\n"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date.prototype.toJSON = &lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;(value) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (isNaN(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.valueOf())) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; origDateToJSON.call(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;, value);&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt; newStringify(value, replacer, space) {&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Return undefined when value parameter is undefined&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// or when toJSON exists and returns undefined&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((value === undefined) &amp;amp;&amp;amp; !(replacer)) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (value &amp;amp;&amp;amp; &lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; value === &lt;SPAN style="COLOR: #a31515"&gt;'object'&lt;/SPAN&gt; &amp;amp;&amp;amp;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; value.toJSON === &lt;SPAN style="COLOR: #a31515"&gt;'function'&lt;/SPAN&gt; &amp;amp;&amp;amp;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;!replacer &amp;amp;&amp;amp; value.toJSON(&lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;) === undefined)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Return undefined when value paramenter is a function&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; value === &lt;SPAN style="COLOR: #a31515"&gt;"function"&lt;/SPAN&gt;) &amp;amp;&amp;amp; !(replacer)) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Ignore the replacer and do not throw an error if the replacer &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// is not a function or array.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (replacer &amp;amp;&amp;amp; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; replacer !== &lt;SPAN style="COLOR: #a31515"&gt;"function"&lt;/SPAN&gt;)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp;&amp;amp; !(replacer &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Array))&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacer = &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (space !== undefined) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Treat empty string as no space&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (space === &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;) space = 0;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; space === &lt;SPAN style="COLOR: #a31515"&gt;"object"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If space is a Number object or String object &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// use it's primitive value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((space &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Number) || (space &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; String))&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;space = space.valueOf();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Ignore objects other than Number and Strings&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; space = 0;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If space is set to a value greater than 10, space should be &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// defaulted to 10. If space is not integral, use the floor value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If space string has a length greater than 10, &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// space should be defaulted to first 10 characters&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; space === &lt;SPAN style="COLOR: #a31515"&gt;"number"&lt;/SPAN&gt;) space = Math.min(10,&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Math.floor(Math.abs(space)));&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; space === &lt;SPAN style="COLOR: #a31515"&gt;"string"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (space.length &amp;gt; 10)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;space = space.slice(0, 10);&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; space = 0;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Return primitive number, string or boolean value stored&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// in the Number, String or Boolean object&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt; newReplacer(key, value) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Execute the replacerand get it's return value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; tmpValue = replacer.call(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;, key, value);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If value is a Number or String or Boolean object &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// use its primitive value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; tmpValue === &lt;SPAN style="COLOR: #a31515"&gt;"object"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((tmpValue &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Number) || (tmpValue &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; String) ||&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(tmpValue &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Boolean)) tmpValue = tmpValue.valueOf();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; tmpValue;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt; {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Check if the replacer returns undefined or a function&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If it does, return undefined&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; tmpValue = value;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (replacer &amp;amp;&amp;amp; &lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; replacer === &lt;SPAN style="COLOR: #a31515"&gt;"function"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tmpValue = newReplacer.call({ &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;: tmpValue }, &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;, tmpValue);&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((tmpValue === undefined) ||&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; tmpValue == &lt;SPAN style="COLOR: #a31515"&gt;'function'&lt;/SPAN&gt;)) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; builtinStringify(value, newReplacer, space);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; builtinStringify(value, replacer, space);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Throw a Type Error if value is a cyclic objects&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (e) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; replacementException = e;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (e.number === -2146823254) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; TypeError();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException.description = e.description;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException.message = e.message;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException.number = e.number;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt; replacementException;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Because the above patch primarily deals with errors that arise from improperly calling the JSON functions it is most useful while you are debugging your code. When you code is ready for production you may not need to use.&lt;/P&gt;
&lt;P&gt;Note: Apart from the above differences due to the changes in the ES5 draft specifications for JSON, there is a known issue which currently exists for IE8. The details of the same along with the possible workarounds are covered in this blog &lt;A href="http://blogs.msdn.com/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx" mce_href="http://blogs.msdn.com/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx"&gt;post&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In case you will like to follow the discussions by the TC39 members around how the standard is taking shape, and the discussion around the changes for JSON, you can refer the discussion archives &lt;A href="https://mail.mozilla.org/pipermail/es5-discuss/" mce_href="https://mail.mozilla.org/pipermail/es5-discuss/"&gt;here&lt;/A&gt;. The latest ES5 drafts are available at the &lt;A href="http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft" mce_href="http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft"&gt;ECMAScript wiki&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Gaurav Seth, Program Manager, JScript&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9798184" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category></item><item><title>Internet Explorer 8 Release Candidate Now Available</title><link>http://blogs.msdn.com/jscript/archive/2009/01/27/internet-explorer-8-release-candidate-now-available.aspx</link><pubDate>Mon, 26 Jan 2009 23:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9376222</guid><dc:creator>GauravS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9376222.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9376222</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9376222</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2009/01/26/internet-explorer-8-release-candidate-now-available.aspx"&gt;&lt;FONT color=#0000ff&gt;Internet Explorer 8 Release Candidate Is Now Available&lt;/FONT&gt;&lt;/A&gt;.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Here is post that would help you &lt;A href="http://blogs.msdn.com/ie/archive/2009/01/26/upgrading-to-internet-explorer-8-release-candidate-1.aspx"&gt;Upgrade to Internet Explorer 8 Release Candidate 1&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Note: The comments on this blog are blocked. Pl post your comments on the &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;A href="http://blogs.msdn.com/ie/"&gt;&lt;I&gt;IE team blog&lt;/I&gt;&lt;/A&gt;&lt;I&gt;, so that they can be collated at one place.&lt;/I&gt;&lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Gaurav Seth&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Program Manager&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;JScript Team&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9376222" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JavaScript+Performance+IE/default.aspx">JavaScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+functions/default.aspx">JScript functions</category><category domain="http://blogs.msdn.com/jscript/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Developers/default.aspx">Developers</category></item><item><title>GC Improvements in JScript for Internet Explorer 8 Beta 1</title><link>http://blogs.msdn.com/jscript/archive/2008/04/23/gc-improvements-in-jscript-for-internet-explorer-8-beta-1.aspx</link><pubDate>Wed, 23 Apr 2008 15:56:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8418992</guid><dc:creator>JSBlog</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8418992.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8418992</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8418992</wfw:comment><description>&lt;p&gt;Hello Friends,&lt;/p&gt;  &lt;p&gt;Today I am going to talk about some of the Garbage Collector improvement we have done. Actually the original fix was done in Script 5.7 (shipped with IE7/Vista and &lt;a href="http://blogs.msdn.com/jscript/archive/2007/08/12/windows-script-5-7-released-for-windows-2000-windows-xp-and-windows-2003-server.aspx"&gt;also available on down level platforms&lt;/a&gt;), which we further enhanced in JScript shipped with IE8 Beta1.&lt;/p&gt;  &lt;p&gt;So if you have gone through the &lt;a href="http://blogs.msdn.com/ericlippert/archive/2003/09/17/53038.aspx"&gt;Eric&amp;#8217;s post on JScript Garbage Collector&lt;/a&gt;, you must have noticed following lines&amp;#8230;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&amp;#8220;&lt;/i&gt;&lt;i&gt;Actually what we do is keep track of the number of strings, objects and array slots allocated.&amp;#160; We check the current tallies at the beginning of each statement, and when the numbers exceed certain thresholds we trigger a collection. &amp;#8220;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&amp;#8230;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&amp;#8220;However, there are some down sides as well.&amp;#160; Performance is potentially not good on large-working-set applications&amp;#8221;.&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;The three thresholds he talked about were fixed in previous versions of JScript. After each GC cycle, counters were reset to zero. Next time when they hit the thresholds, again GC was triggered and so on.&lt;/p&gt;  &lt;p&gt;This was alright for small scripts as they never create lot of strings and objects and don&amp;#8217;t take much time to execute. But in modern AJAX applications, lots of objects /strings/array entries are created and they live for long enough time. Since rate of object/string/array entry creation is too high in these applications, thresholds are hit quite often, GC is triggered but not able to collect anything because things are still alive and there is no garbage. Counters are reset, but within few statements they again hit the thresholds. GC is triggered again but very less is collected and so on.&lt;/p&gt;  &lt;p&gt;So as you see, GC is not able to collect significantly, however it is triggered at fixed intervals (as thresholds are fixed). Each GC cycle proves to be costlier than previous one as more objects have been created since last GC cycle happened.&lt;/p&gt;  &lt;p&gt;So to fix this problem, we made the three thresholds adaptive. After each GC cycle, we check if GC was profitable or not, meaning significant collection happened or not. If it was not, then we double the thresholds. If it was, then the thresholds are not changed. Obviously there is an upper bound on value of thresholds, beyond which they are not doubled even if GC cycle was not profitable. Also if GC cycle collected everything, thresholds are set to their initial values. &lt;/p&gt;  &lt;p&gt;That&amp;#8217;s it for now. Hope you enjoyed reading it.&lt;/p&gt;  &lt;p&gt;-JP&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8418992" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Garbage+Collection/default.aspx">Garbage Collection</category></item><item><title>Insight into String Concatenation in JScript</title><link>http://blogs.msdn.com/jscript/archive/2008/03/19/insight-into-string-concatenation-in-jscript.aspx</link><pubDate>Wed, 19 Mar 2008 13:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8325440</guid><dc:creator>janakiram.msv</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8325440.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8325440</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8325440</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Hello Friends,&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Have you read my &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/jscript/archive/2007/10/17/performance-issues-with-string-concatenation-in-jscript.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;post on the String Concatenation&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; issue? If yes, then I can sense your curiosity to know a little bit more about what went on behind the scenes. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;For example, what is the new algorithm used to get to the performance results projected in the blog, what were the issues faced, how tough/easy it was to implement etc. etc. Well, I didn’t talk much about all these last time as we were still testing the fix and things were not stable at that point of time. But now since IE8 Beta is out and you are already running it on your box (if not, &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/Install.htm"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;install from here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;) and loving it &lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;, why not talk a little bit more and try to get few of the queries answered.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;In the new implementation, which is running on your box if you are reading this in IE8, we don’t produce actual regular string for each append operation anymore. Instead, we keep the information about all strings which took part in the append operation. The production of actual regular string is deferred for later point of time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Let’s apply it on the same example I used in the previous blog post… &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #7030a0; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi"&gt;&lt;FONT size=3&gt;resultStr = “Jscript” + “String” + “Append” + “problem”&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;In the previous implementation, we used to produce the actual string and store it in the resultStr. In the current implementation, resultStr points to a structure (let’s call it &lt;B style="mso-bidi-font-weight: normal"&gt;pseudo-string&lt;/B&gt;), which keeps the details like what all strings are needed to produce actual string and in which order.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The logic looks simple. However there were few issues we faced while implementing it, which I think are worth sharing here… &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;When to Convert pseudo-string back to actual String&lt;/B&gt; – As Eric mentioned in his &lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/ericlippert/archive/2003/10/20/53248.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;blog&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;, their ‘Fancy-String’ implementation was heavy as they had to convert ‘Fancy–Strings’ back to regular string every time one is passed by variable reference. We also had this big question facing us – ‘When to convert pseudo-strings back to regular strings’? Should it be done as soon as ‘pseudo-string’ has grown to certain size or should it be done soon after append operation is done? Or should it be done when it is passed by variable reference? We evaluated all these approaches but none of them seemed to be giving the kind of gains we wanted. Later we thought why not defer the conversion to the point when pseudo-string can’t serve the purpose and we have to have the regular string. In other words, do the conversion only when actual regular string is needed. For example do the conversion when a ‘subStr’ or ‘trim’ operation is performed on the ‘pseudo – string’ or when the pseudo string needs to be passed somewhere out of the engine, like IE or VBScript, that doesn’t understand pseudo-strings. We tried it and yes, with this, we hit bulls-eye&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Multiple References to single Pseudo-String&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;If there are multiple references to a single ‘pseudo-string’, then we want to do the conversion only once. For example…&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; mso-add-space: auto" class=MsoListParagraphCxSpFirst&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: FR; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri" lang=FR&gt;X = “Hi” + “Microsoft”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; mso-add-space: auto" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-ansi-language: FR; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri" lang=FR&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Y = X;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt 0.75in; mso-add-space: auto" class=MsoListParagraphCxSpLast&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-ansi-language: FR; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri" lang=FR&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;Z= X;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;In this example X, Y and Z are pointing to the same pseudo-string. Now if x.toString() is called, one approach is, allocate a buffer of size 11 and copy the strings “HI” and “Microsoft” one by one to the buffer. Later when Y.toString() and Z.toString() are called, we again allocate new buffers for each of them and copy the strings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Hmmm. with such multiple allocations and copy operations, are we not back to the problem we were trying to solve? Yes, we are. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;So how did we address this? Well, we decided not to have X, Y and Z point to actual pseudo-String. Instead they point to a proxy object, which keeps actual reference to pseudo-string. When X.toString() is called, conversion from pseudo-string to regular string happens (a new buffer of enough size is allocated and strings are copied one by one) and the proxy object is made point to regular string. Later when Y.toString() and z.toString() are called, we need not do the conversion again as they point to the proxy-object which already points to the regular string. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;So X, Y and Z always point to the proxy-object. Proxy object may either contain a pseudo-string or a regular string, depending upon the time of conversion.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;What if Pseudo-string is partially converted to regular string?&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; mso-add-space: auto" class=MsoListParagraphCxSpFirst&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;X = “Jscript” + “Team”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: 0.25in; mso-add-space: auto" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Z = X&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;+ “Microsoft”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt 0.75in; TEXT-INDENT: 0.25in; mso-add-space: auto" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;X.toString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;In above snippet, X is a pseudo string and is used in formation of another pseudo string Z. Now toString() is called on X, so X has to be converted to regular string. Fine. I can do it. But wait a moment. X is used by another pseudo string Z. I can’t convert it just like that? &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Well, as I said, all references to a pseudo-string are through the proxy-object. Hence Z also refers to the proxy object for X, not to the actual pseudo-string. So even after X is converted to the regular string, references to proxy object remain alive and things work perfectly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;And yes we had to test it &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;‘Maintaining compatibility is priority no. 1’ – this is the mantra we all in the team swear by. At any cost we had to ensure that we don’t break real world when fix is out. Our test team has done an awesome job in ensuring it. They found couple of cool crashes, which were not directly in the new implementation, but because new implementation broke few assumptions made in the engine. Interesting part is that they were reported on the last day of our internal milestones; therefore we had to sit whole night gazing at our screens, fixing and testing them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;This is all about string append problem and I hope it was an interesting read. One more interesting performance improvement I have worked on in this release and would like to share with you all is ‘Arrays’, but we’ll leave that for another post so stay tuned.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;JP&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8325440" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category></item><item><title>Thank you - Smartsheet !</title><link>http://blogs.msdn.com/jscript/archive/2008/01/22/engaging-with-customers.aspx</link><pubDate>Tue, 22 Jan 2008 11:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7195772</guid><dc:creator>don.raman</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jscript/comments/7195772.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=7195772</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=7195772</wfw:comment><description>&lt;P&gt;We are constantly&amp;nbsp;looking to engage with our customers on this blog and understand their pain-points, and in that spirit, it was really heartening to see the &lt;A class="" href="http://www.smartsheet.com/node/722" mce_href="http://www.smartsheet.com/node/722"&gt;blog post&lt;/A&gt; by Mark Mader from &lt;A class="" href="http://www.smartsheet.com/about" mce_href="http://www.smartsheet.com/about"&gt;Smartsheet&lt;/A&gt;. The JScript team is very appreciative of this kind of customer engagement and hope more customers frequent this blog and provide feedback to us. This helps us understand problems real-world customers face&amp;nbsp;and provide solutions that benefit other customers.&lt;/P&gt;
&lt;P&gt;Thank you, Mark !&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Don Raman&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7195772" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category></item><item><title>Performance issues with "String Concatenation" in JScript.</title><link>http://blogs.msdn.com/jscript/archive/2007/10/17/performance-issues-with-string-concatenation-in-jscript.aspx</link><pubDate>Wed, 17 Oct 2007 15:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5490933</guid><dc:creator>shivaram.p</dc:creator><slash:comments>32</slash:comments><comments>http://blogs.msdn.com/jscript/comments/5490933.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=5490933</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=5490933</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Hello Friends, &lt;BR&gt;I am Jaiprakash and work as a Developer in the Jscript team. There is not much to tell about me except one fact - I can’t recall the last time when any of my teammates called me by my name, they just call me JP&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;I know, you have seen pretty cool blogs in past from my team mates and I promise this one also not going to disappoint you. So coming to the point, I am going to talk about the &lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/ericlippert/archive/2003/10/20/53248.aspx"&gt;&lt;FONT face=Calibri color=#800080 size=3&gt;famous ‘string append&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;’ problem in Internet Explorer (or Jscript to be more accurate) and how are we going to &lt;B style="mso-bidi-font-weight: normal"&gt;fix &lt;/B&gt;it. &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;The Problem&lt;BR&gt;&lt;/B&gt;let’s do a small experiment to get to it. Copy paste following code in an html file and run in Internet Explorer. Observe the time reported.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="COLOR: #7030a0; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi"&gt;&lt;FONT size=3&gt;&amp;lt;script language="javascript"&amp;gt;&lt;BR&gt;var before = new Date().getTime();&lt;BR&gt;var s = "jscript";&lt;BR&gt;x = "";&lt;BR&gt;count = 20000;&lt;BR&gt;for (var i = 0; i &amp;lt; count; i++) {&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;x += s;&lt;BR&gt;}&lt;BR&gt;var after = new Date().getTime();&lt;BR&gt;var time = after - before;&lt;BR&gt;alert("Time taken to append 'jscript' " + count + " times : " + time + " ms");&lt;BR&gt;&amp;lt;/script&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;On my machine the time reported is 1922 ms (averaged out three times). As you see this code is doing nothing other than appending a 7 character string 20K times. And for such a trivial operation it is consuming almost 2 seconds. Phewww….&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Impressed? Not yet. It still doesn’t appeal you? OK. Try increasing the no of appends and enjoy the show. Here is what I get on my box…&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: auto auto auto 63.9pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-themecolor: text1" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 50.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: background1; mso-background-themeshade: 217" vAlign=top width=67&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Appends&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-left-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Time (ms)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 50.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=67&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;10K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;260&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 50.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=67&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;20K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;1922&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 50.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=67&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;25K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;6125&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 4; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 50.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=67&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;30K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;11578&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;BR&gt;&lt;FONT face=Calibri size=3&gt;Well, I am sure you would be impressed by now. And I can feel your curiosity to know how Jscript makes such a trivial looking operation such a big one. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Not much, it uses a very trivial algorithm to append strings to get you to such a great show.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Whenever it has to append two strings of size &lt;I style="mso-bidi-font-style: normal"&gt;‘m’&lt;/I&gt; and &lt;I style="mso-bidi-font-style: normal"&gt;‘n’&lt;/I&gt; each, it allocates a new buffer of size &lt;I style="mso-bidi-font-style: normal"&gt;(m + n)&lt;/I&gt;, copies the strings one by one, and returns this buffer back. Hmmm. This logic looks fine. What’s the deal then? &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Let’s say you want to append 3 strings like following...&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="COLOR: #7030a0; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi"&gt;&lt;FONT size=3&gt;resultStr = “Jscript” + “String” + “Append”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;To give you the final result, Jscript first appends &lt;SPAN style="COLOR: #7030a0"&gt;“Jscript”&lt;/SPAN&gt; and &lt;SPAN style="COLOR: #7030a0"&gt;“String”.&lt;/SPAN&gt; It allocates a buffer of size 13, copies them one by one to the buffer and assigns the buffer to a temporary, let’s say temp1. Next it appends temp1 and &lt;SPAN style="COLOR: #7030a0"&gt;“Append”&lt;/SPAN&gt;, allocates a buffer of size 19, copies temp1 and &lt;SPAN style="COLOR: #7030a0"&gt;“Append”&lt;/SPAN&gt;, and assigns the result to resultStr.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;As you see, to generate final string for you it copied &lt;SPAN style="COLOR: #7030a0"&gt;“Jscript”&lt;/SPAN&gt; and &lt;SPAN style="COLOR: #7030a0"&gt;“String”&lt;/SPAN&gt; twice (temp1 and resultStr) and allocated one intermediate buffer. Imagine what happens when you append ‘n’ such strings. It will allocate n-1 buffers, copy each string (n-i) times where ‘i’ is the index at which the string appeared in the operation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;You might be thinking why Jscript was shipped with such an algorithm. Well, Jscript was meant to be used just as glue, not as full-fledge programming language as used in modern WebApps.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;How it affects Real world Scenarios&lt;BR&gt;&lt;/B&gt;Gone are the days when web apps used to be static text which was just retrieved from the server and displayed in your browser. Today’s world is AJAX, involves lot more interaction with server, and data received is not just the plain HTML. A modern WebApp fetches data from server; builds the page on your machine using Jscript and DOM APIs, and displays on your browser. And to build the page it has to generate HTML, which is nothing but text. And to generate HTML out of the pieces retrieved from server, it has to append them as strings. And as the applications are becoming smarter and smarter, they tend to minimize the interaction with server, and do as much processing as possible in your browser. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Let me give you some real world examples. You all must have used some or the other AJAX mail client like msn.com, outlook web access or yahoo mail beta. In your inbox, if you scroll down or up, they just update your mail list not the entire page. How it happens? It gets the information about mails from server, builds the table of your mails on the fly and displays in the browser. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Another good example would be &lt;/FONT&gt;&lt;A href="http://www.redfin.com/"&gt;&lt;FONT face=Calibri size=3&gt;Redfin&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; which is actually AJAX based real estate portal. If you search a locality, it shows a map with location of all the results and below the map it shows details of each result. This table it constructs by appending several hundreds of strings.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;These are just two. There are many more such. Basically what I want to convey is that string append is a pretty common and basic operation and probability is very high that large number of web apps get affected by this.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;So we are fixing it!!!&lt;BR&gt;&lt;/B&gt;We are trying an algorithm which avoids those intermediate buffer allocations and repeated copy operations. With this algorithm, I just ran the same test case and here are the numbers for you. Please note that the fix is still under progress so these numbers might change a bit here and there, however they should be enough to give you an idea of improvements.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: auto auto auto 63.9pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid black .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-themecolor: text1" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 69.65pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: background1; mso-background-themeshade: 217" vAlign=top width=93&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Appends&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-left-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Time (ms)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 69.65pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=93&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;10K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 69.65pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=93&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;20K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;47&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 69.65pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=93&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;25K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;62&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 4; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 69.65pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-themecolor: text1" vAlign=top width=93&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;30K&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; WIDTH: 66.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-themecolor: text1; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=89&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;78&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Shhhh. Numbers speak for themselves&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;JP, I Need this fix on my box, now!!!&lt;BR&gt;&lt;/B&gt;I wish I could help you. You will have to wait till next release of Internet Explorer.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;At last…&lt;BR&gt;&lt;/B&gt;Please help us in helping you. If you have encountered other such script “hairballs”, do leave a note on any of the blogs published here. I want to publish more such blogs for you&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;- JP&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5490933" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JavaScript+Performance+IE/default.aspx">JavaScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category></item><item><title>Automatic Update for JScript which is part Windows Script 5.7 release</title><link>http://blogs.msdn.com/jscript/archive/2007/09/15/automatic-update-for-windows-script-5-7-release.aspx</link><pubDate>Sat, 15 Sep 2007 09:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4924391</guid><dc:creator>don.raman</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/jscript/comments/4924391.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=4924391</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=4924391</wfw:comment><description>&lt;P&gt;There has been some request and suggestion that when the JScript team feels that there are so many advantages of JScript update which went as part of Windows Script 5.7 release, why this is not being pushed as part of Windows Automatic Update. Well, we do agree that making the JScript DLL (which is part Windows Script 5.7 package)&amp;nbsp;delivered as&amp;nbsp;automatic update will indeed help us in many ways including:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Reaching a huge number of our customers. This being a push rather than a pull (where the user needs to go and download the package from Microsoft Download Center) will certainly help in having this installed on a large number of machines.&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;Web site owners/developers whose site has improved will indeed want to have their customer see the same improvements. Now the chances that their customer will also go to the download link and download the package is again bit low. However doing an automatic update will help them too.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;When Microsoft started the concept of automatic update, many items like a bug fix/feature request also made part of this. This lead to some system being broken. So people were generally skeptical consuming the latest updates and be broken. Instead they chose to be vulnerable. &lt;/P&gt;
&lt;P&gt;Microsoft as a company has tried its level best to erase this perception. As a result of this only high vulnerable bug fix (security bugs) and similar items are only passed as part of auto-update. This is to make sure that we push things which are extremely of high importance from security/vulnerability point of view. So it's very difficult to push in general bug fixes through auto-update.&lt;/P&gt;
&lt;P&gt;However all said the JScript team is looking at this as a priority and we are going to make a case for this. Stay tuned for further updates.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Don Raman&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4924391" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category></item><item><title>Regular Expression optimization done in Jscript 5.7 release</title><link>http://blogs.msdn.com/jscript/archive/2007/09/05/regular-expression-optimization-done-in-jscript-5-7-release.aspx</link><pubDate>Thu, 06 Sep 2007 01:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4773011</guid><dc:creator>don.raman</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jscript/comments/4773011.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=4773011</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=4773011</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;I modified my &lt;A href="http://blogs.msdn.com/jscript/archive/2007/08/12/windows-script-5-7-released-for-windows-2000-windows-xp-and-windows-2003-server.aspx" target=_blank mce_href="http://blogs.msdn.com/jscript/archive/2007/08/12/windows-script-5-7-released-for-windows-2000-windows-xp-and-windows-2003-server.aspx"&gt;&lt;SPAN style="COLOR: blue"&gt;last&lt;/SPAN&gt;&lt;/A&gt; blog many times. I was really amazed at the kind of response I got on this blog. Thanks for taking time and putting all the comments. Today I am going to talk at length the "Regular Expression" optimization we did in JScript that shipped with Windows Script 5.7 release. I could have changed my &lt;A href="http://blogs.msdn.com/jscript/archive/2007/08/12/windows-script-5-7-released-for-windows-2000-windows-xp-and-windows-2003-server.aspx" target=_blank mce_href="http://blogs.msdn.com/jscript/archive/2007/08/12/windows-script-5-7-released-for-windows-2000-windows-xp-and-windows-2003-server.aspx"&gt;&lt;SPAN style="COLOR: blue"&gt;last&lt;/SPAN&gt;&lt;/A&gt; blog but since I have already changed it so many times, I think it's just better to write a new one.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Web Developers who are using &lt;A href="http://www.json.org/" target=_blank mce_href="http://www.json.org/"&gt;&lt;SPAN style="COLOR: blue"&gt;JSON&lt;/SPAN&gt;&lt;/A&gt; protocol to describe their objects should read this blog as optimizations has been done in this area.If you are looking for other fixes that has gone in this release please get them from &lt;A href="http://download.microsoft.com/download/f/f/e/ffea3abf-b55f-4924-b5a5-bde0805ad67c/Windows%20Script%20Release%20Notes.rtf" target=_blank mce_href="http://download.microsoft.com/download/f/f/e/ffea3abf-b55f-4924-b5a5-bde0805ad67c/Windows%20Script%20Release%20Notes.rtf"&gt;&lt;SPAN style="COLOR: blue"&gt;here&lt;/SPAN&gt;&lt;/A&gt;. The improvements are quite evident for web sites which are using JSON protocol to define their objects. We got to know about this performance bug from our Windows Live team when they complained about poor performance of their web site while using JSON protocol. We were close to 30 times slower than the competition.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Now, let's take a moment to define what exactly was causing the problem. As part of using JSON protocol usage on Windows Live site, the code used to do pattern matching on a regular expression and further do some kind of replacement of matched string with a fixed specified string. The CPU time spend in doing this pattern matching and replace was very high which lead to the performance of site being bad.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Let’s take the example of the specified regular expression : &lt;B&gt;&lt;I&gt;/(["'])(&lt;/I&gt;&lt;/B&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="COLOR: windowtext"&gt;\\.|((?!\1|\\).))*\1/g&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;While matching a pattern for this expressions, before going into the loop, JScript engine compares if source string right now is same as the source string that was present before entering the same loop last time. If source strings are same it doesn't enter the loop .Assumption being&amp;nbsp;none of the characters in the source string were matched in the last iteration and there is no point in taking this loop again (because if this loop is taken again then it means engine is in infinite loop). Otherwise keep checking back all the loops down in the stack until either the above mentioned condition is true (both source strings are same) or it reaches bottom of the stack. If it reached bottom of the stack then this loop can be entered as it means that either this is the first time loop is being taken or loop consumed&amp;nbsp; at least one character last time. Seems pretty perfect logic.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;So what's the flaw with the above logic? What if the engine is going to take same loop but it matched one or more characters in the last branch. In this case above mentioned logic will still keep comparing all the loops till it reaches end of the stack and then it decides to take the loop. This is not correct. If few characters were consumed in the last loop then instead going till end of the stack, it must decide to take a loop as soon as it finds that last time part of the sources string was matched by this loop.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The fix actually addresses this bug. And as a result from being 30 times slower than the competition, we are now at par with competition. Now that's a good enough reason to start using the new JScript if you are using JSON protocol.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Thanks,&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;STRONG&gt;Don Raman.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4773011" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category></item><item><title>Windows Script 5.7 released for Windows 2000, Windows XP and Windows 2003 Server</title><link>http://blogs.msdn.com/jscript/archive/2007/08/12/windows-script-5-7-released-for-windows-2000-windows-xp-and-windows-2003-server.aspx</link><pubDate>Sun, 12 Aug 2007 08:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4346233</guid><dc:creator>don.raman</dc:creator><slash:comments>57</slash:comments><comments>http://blogs.msdn.com/jscript/comments/4346233.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=4346233</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=4346233</wfw:comment><description>&lt;P&gt;I have little announcement to make today. Windows Script 5.7 which ships with different flavors of Windows® Vista is now available for Windows® 2000/XP as well as Windows® 2003 Server. &lt;/P&gt;
&lt;DIV id=quickDescription&gt;This download will install Microsoft® Windows® Script containing Visual Basic® Script Edition (VBScript.) Version 5.7, JScript® Version 5.7, Windows Script Components, Windows Script Host 5.7, and Windows Script Runtime Version 5.7.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Why should you care about this update ? If you ever encountered performance issues running AJAX applications (e.g. Gmail), you should absolutely consider installing this update. This update includes an updated Garbage Collector that used to previously make AJAX appliications run pretty poorly. This update is available on Vista and we are now providing this to all supported OS versions (XP, Win2K, Win2K Server). You will see noticeably better performance on your favorite AJAX applications and with more and more AJAX applications coming on line, you will be very happy you did this.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Below is the download link for the updates.&lt;/DIV&gt;
&lt;P&gt;&lt;A class="" href="http://www.microsoft.com/downloads/details.aspx?familyid=C03D3E49-B40E-4CA1-A0C7-CC135EC4D2BE&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=C03D3E49-B40E-4CA1-A0C7-CC135EC4D2BE&amp;amp;displaylang=en"&gt;Download Windows Script 5.7 for Windows 2000&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=47809025-D896-482E-A0D6-524E7E844D81&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=47809025-D896-482E-A0D6-524E7E844D81&amp;amp;displaylang=en"&gt;Download Windows Script 5.7 for Windows XP&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f00cb8c0-32e9-411d-a896-f2cd5ef21eb4&amp;amp;DisplayLang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f00cb8c0-32e9-411d-a896-f2cd5ef21eb4&amp;amp;DisplayLang=en"&gt;Download Windows Script 5.7 for Windows 2003 Server&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also lot of people might be wondering what all changes has gone inside this release. A quick look at release note will give you all the detail. The release notes can be downloaded from &lt;A class="" href="http://download.microsoft.com/download/f/f/e/ffea3abf-b55f-4924-b5a5-bde0805ad67c/Windows%20Script%20Release%20Notes.rtf" target=_blank mce_href="http://download.microsoft.com/download/f/f/e/ffea3abf-b55f-4924-b5a5-bde0805ad67c/Windows Script Release Notes.rtf"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Happy downloading and enjoy all the benefits of Windows Script 5.7 on other OS too!!&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Don Raman&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4346233" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/AJAX/default.aspx">AJAX</category></item><item><title>Write better JScript code to execute within Internet Explorer (IE)</title><link>http://blogs.msdn.com/jscript/archive/2007/01/24/write-better-jscript-code-to-execute-within-internet-explorer-ie.aspx</link><pubDate>Wed, 24 Jan 2007 17:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1521845</guid><dc:creator>don.raman</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jscript/comments/1521845.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=1521845</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=1521845</wfw:comment><description>&lt;P&gt;This is the first ever blog written by me in my entire life time. Let me take some time to introduce myself. I am Don Raman and work as a Test Lead in Microsoft India Development Center at Hyderabad. A part of my responsibility is to own the testing of JScript native language. I joined Microsoft six months back and I am pretty excited about working in such a great company. I am going to give some pointers/links to some good paper written by Microsoft employees which will help a JScript programmer write more efficient code.&lt;/P&gt;
&lt;P&gt;Any programming language gives flexibility to the programmer to write the logic (code) using different language constructs. The same thing can be achieved in a different way. A programmer may think why writing code in a certain way will make things faster. But the way dynamic languages are architected it is very much possible that certain constructs or tricks can make your program run faster. Below are links which will definitely make you a more efficient JScript programmer.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2006/08/28/728654.aspx" mce_href="http://blogs.msdn.com/ie/archive/2006/08/28/728654.aspx"&gt;http://blogs.msdn.com/ie/archive/2006/08/28/728654.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2006/11/16/ie-javascript-performance-recommendations-part-2-javascript-code-inefficiencies.aspx" mce_href="http://blogs.msdn.com/ie/archive/2006/11/16/ie-javascript-performance-recommendations-part-2-javascript-code-inefficiencies.aspx"&gt;http://blogs.msdn.com/ie/archive/2006/11/16/ie-javascript-performance-recommendations-part-2-javascript-code-inefficiencies.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2007/01/04/ie-jscript-performance-recommendations-part-3-javascript-code-inefficiencies.aspx" mce_href="http://blogs.msdn.com/ie/archive/2007/01/04/ie-jscript-performance-recommendations-part-3-javascript-code-inefficiencies.aspx"&gt;http://blogs.msdn.com/ie/archive/2007/01/04/ie-jscript-performance-recommendations-part-3-javascript-code-inefficiencies.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The above articles are extremely good to understand some of the things going behind the code. It also has got some excellent post from the web community.&lt;/P&gt;
&lt;P&gt;Thanks a lot for reading this post and I hope you have got benefited out of it.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1521845" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JavaScript+Performance+IE/default.aspx">JavaScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category></item></channel></rss>