In an interview with eWEEK, Eich said Mozilla began work on TraceMonkey just over 60 days ago with the help of Andreas Gal of the University of California, Irvine. And TraceMonkey is slated for inclusion in Firefox 3.1, Eich said.
In a post on Ajaxian.com, Ben Galbraith, co-founder of Ajaxian, said:
Added Eich, “We’re supporting a bunch of platforms out of the box, including ARM, so we’re supporting mobile Firefox.”
In a section of his post describing “What it all means,” Eich said:
““We have, right now, x86, x86-64, and ARM support in TraceMonkey. This means we are ready for mobile and desktop target platforms out of the box.As the performance keeps going up, people will write and transport code that was -too slow’ to run in the browser as JS. This means the web can accommodate workloads that right now require a proprietary plug-in.As we trace more of the DOM and our other native code, we increase the memory-safe code base that must be trusted not to have an exploitable bug.Tracing follows only the hot paths, and builds a trace-tree cache. Cold code never gets traced or JITted, avoiding the memory bloat that whole-method JITs incur. Tracing is mobile-friendly.JS-driven <canvas> rendering, with toolkits, scene graphs, game logic, etc. all in JS, are one wave of the future that is about to crest.”“
Moreover, Eich said, “TraceMonkey advances us toward the Mozilla 2 future where even more Firefox code is written in JS. Firefox gets faster and safer as this process unfolds.”
Mike Shaver, vice president of engineering at Mozilla, said of the TraceMonkey results:
Describing the concept of tracing, Resig wrote:
““In simple terms tracing works by 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 premise is rather simple-and it’s an advance that we’ll probably see proliferate to many interpreters and engines in the upcoming years.”“
“You record the instructions the interpreter is executing, like a VCR,” Eich said.
Opening New Opportunities
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:
“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.”