SBala

JavaScript Interpretations

Internet Explorer is finished. End of story. If there was any hope for the buggy browser from Redmond waiting to surprise thousands of developers, it has now been put to rest by the onslaught of JavaScript performance increases. While Internet Explorer is still catching up on trying to render CSS correctly, its primary competition - Webkit and Gecko - are speeding ahead. The Browser Wars are alive again, and this time IE is not invited to party.

It started ten months ago when I noticed Minefield (Firefox's Nightly Build) renderring pages faster than anything I had used before. I read into it - Mozilla had developed a new JavaScript interpretation engine called SpiderMonkey, which improved performance on top of the improved memory consumption and an "Awesome Bar" interface. I thought Firefox had just won. I was wrong.

It was after Firefox 3's glory was made public to the world on a record-setting launch date that WebKit announced some very interesting news. They unveiled Squirrelfish.

SquirrelFish is a register-based, direct-threaded, high-level bytecode engine, with a sliding register window calling convention. It lazily generates bytecodes from a syntax tree, using a simple one-pass compiler with built-in copy propagation[...]

SquirrelFish’s bytecode engine elegantly eliminates almost all of the overhead of a tree-walking interpreter. First, a bytecode stream exactly describes the operations needed to execute a program. Compiling to bytecode implicitly strips away irrelevant grammatical structure. Second, a bytecode dispatch is a single direct memory read, followed by a single indirect branch. Therefore, executing a bytecode instruction is much faster than visiting a syntax tree node. Third, with the syntax tree gone, the interpreter no longer needs to propagate execution state between syntax tree nodes.


After the introduction of Squirrelfish, WebKit and Safari seemed much more appealing; until Google unveiled their Chrome Browser. Google Chrome uses the WebKit rendering engine for HTML and CSS, but opted to create a separate JavaScript implementation for performance. Google's V8 JavaScript Engine increases performance by compiling JavaScript to native machine code before running it, rather than to a bytecode or interpreting it. Thus, JavaScript applications will run at the speed of a compiled binary.

As if Chrome's V8 engine were not an advancement enough, Firefox's TraceMonkey JavaScript engine took shape in their beta version of Firefox 3.1. TraceMonkey utilizes a technique called tracing to speed up JavaScript performance. Tracing involves watching for commonly-repeated actions (such as loops, function calls, or type checking) and tries to optimize their resulting native code into the lowest number of actions. The performance war didn't end here either, however.

SquirrelFish, not to be outdone, was reincarnated into SquirrelFish extreme.

SquirrelFish Extreme uses four different technologies to deliver much better performance than the original SquirrelFish: bytecode optimizations, polymorphic inline caching, a lightweight “context threaded” JIT compiler, and a new regular expression engine that uses our JIT infrastructure.


Opera is left out from the JavaScript optimizations, but Internet Explorer improvement is nonexistent in the realm of standards-compliant browsers. With very little known as to what exactly the future will hold, it is still certain that web development will entail newer, faster, and more exciting enhancements.

| January 1, 2009 at 11:34am | 0 Comments

The Web: Phasing Out IE6

At first glance at this update from 37Signals, I shrugged and said my usual cynical, "Who cares?" until I realized the drastic progression ensuing the process of companies slowly ditching support for the outdated and bug-ridden Internet Exploerer 6. 37Signals is phasing out Internet Explorer 6 support on every single product they distribute, and is starting a trend that is much appreciated by almost every web developer. If this catches onto more mainstream markets, in which major online players eventually decide to cut Internet Explorer 6 off, more websites will focus on creating semantic and standards-compliant code rather than violating standards and ruining clean code in order to properly display in an outdated browser. The catch, 26.5% of web surfers are using Internet Explorer 6. Although that number may be a minority, it is still a large audience.

Microsoft has updated Internet Explorer to version 7. Many people view this browser with mixed emotions; it heavily improves upon its prior releases, but it still is a far way from true standards compliance.

Firefox, however, is slowly changing the complications commonly associated with technologies surrounding web site presentation. With its 41% market share, Firefox has heavily optimized both resource usage and rendering. The improvements made by Apple and Opera are also putting pressure on the not-so-dominant Internet Explorer for change.

The pressure put on Microsoft by the browser developments made by Opera, Apple, and Mozilla are still not enough to reduce the 26.5% if people still make the web work well on Internet Explorer. What most developers who consider the needs of Internet Explorer users are missing is the fact they they are encouraging the use of an outdated browser that cannot properly handle modern tasks. Programmers are supplementing proper coding with hacks, and hindering the future implementations of CSS3, JavaScript 1.6+, and XHTML 2.0.

Once users see a majority of the web as a disfunctional mess, only to realize it was their own fault for ignoring the pestering Windows Update notifications, they will adopt browsers that give them a better experience whilst also allowing developers to use the web-based technologies they want to implement.

| July 4, 2008 at 3:59pm | 1 Comment

 1