Mozilla Speeds Up JavaScript with TraceMonkey - Opening New Opportunities (
Page 3 of 3 )
Eich also noted that this TraceMonkey news is "only a start. With
tracing, performance will keep going up. We have easy small linear speedup
tasks remaining (better register allocation, spill reduction around built-in
calls). We will trace string and regular expression code. ... We will even
trace into DOM methods. The tracing JIT
approach scales as you move more code into JS, or otherwise into view of the
tracing machinery."
So what does this all mean, you might ask? Well, Resig asked the same
question and answered it:
"It means that JavaScript is no longer confined by the previously challenging
resource of processing power. With this improvement it's leapfrogged any sort
of traditional and has gone head-to-head with computationally powerful
languages like C."
Resig also said he expects to see "more, massive projects being written
in JavaScript," including projects that expect the performance gains that
we're starting to see, such as "applications that are number-heavy [like
image manipulation] or object-heavy [like relational object structures]."
For his part, Resig said he is especially interested in how TraceMonkey will
impact development using Canvas. Canvas is an HTML element that can be used to
draw graphics using scripting, typically with JavaScript.
"The primary thing holding back most extensive Canvas development
hasn't been rendering—but the processor limitations of the language: performing
the challenging mathematical operations related to vectors, matrices or
collision detection," Resig said. "I expect this area to absolutely
explode after the release of Firefox 3.1 as we start to see this work take
hold."
Eich said he expects other browsers to follow suit and begin to use JIT
compilation for JavaScript.
"I believe that other browsers will follow our lead and take JavaScript
performance through current interpreter speed barriers, using just-in-time
native code compilation," Eich said. "Beyond what TraceMonkey means
for Firefox and other Mozilla projects, it heralds the JavaScript Lightspeed
future we've all been anticipating. We are moving the goal posts and changing
the game, for the benefit of all Web developers."