While conducting tests of different browsers using SunSpider Benchmark, the engineers at Mozilla found a rather queer bug. IE9 was specifically altered to load an optimized result while running a benchmarking tool. Mozilla’s engineer Rob Sayre reported his findings with Microsoft in Microsoft Connect.

The basic problem is that IE browser, while running the JavaScript code, should perform an optimization for dead code in the code block. This is particularly tested by set of functions in SunSpider benchmark, but when the benchmarking code is altered, the results vary. IE doesn’t perform as expected.


Lets say we have a piece of JavaScript code which is unreachable. The browser should eliminate that and optimize the code to perform faster. This, as previously mentioned, is done as a test environment in SunSpider. The basic idea is the more the dead-code, less real and executable code, the browser should perform faster.  But when in case of IE9, more the dead code included the browser performance degrades rapidly. This can happen only when the removable or dead codes are not being optimized and browser is actually dealing with all those garbage code.

The trick lies in the fact that, IE9 performs really well in an unaltered SunSpider Benchmark, but when benchmark is altered by adding more of the dead codes, it doesn’t perform as expected.

It is being speculated, that IE in itself is not performing these optimization on a real world scenario but rather has been optimized to give a good result in benchmark.

A hot debate is going on in Hacker News and many have performed independent benchmarking tests to come to the same conclusion.

Also Read:

A full time developer and a part time blogger, but above all a person with extreme passion about anything with a 'Tech'. You can find him at UjjwalKanth.com, and follow him at @ujjwalkanth