Summit2008/Sessions/Proposals/Tracing and JavaScript performance

From MozillaWiki
Jump to: navigation, search

Andreas Gal, Jim Blandy, Brendan Eich, Mike Shaver

Tracing and JavaScript performance

Tracing is a technique for implementation of just-in-time compilation well-suited to the needs of JavaScript on the web: it exhibits extremely good compilation performance (in space and speed), even when performing aggressive optimizations, and can efficiently cope with dynamic typing. In addition, it can be implemented in a minimally invasive and incremental manner. Tracing is employed in the experimental Hotpath Java virtual machine, the upcoming luajit2 implementation of the Lua language, the "Tamarin Tracing" ActionScript/JavaScript runtime, and now in the "Tracemonkey" project to bring native code performance to Mozilla's Spidermonkey JavaScript engine.

This session will provide a background in trace-based JIT compilation, an overview of the current state of Mozilla's tracing-related work, and future plans. Spirited discussion of relative implementation priorities and schedules will no doubt ensue.

Fundamentals of tracing: an introduction to the basic principles of tracing (link to papers)

  • trace specialization and guarding
    • shape induction
  • interaction between interpreter and JIT compiler
  • applying optimizations to traces

nanojit: a lightweight native code generator specialized for tracing

  • implementation of TSSA
  • back-end implementation status

Tamarin Tracing status:

  • relationship to "Tamarin Central"
  • status and near-term goals
  • performance characteristics
  • current challenges

Tracemonkey status: an overview of current Tracemonkey capabilities, and discussion

  • differences from Tamarin Tracing
  • work so far (timeline, design choices)
  • near-term goals
  • preliminary performance results
  • current challenges

Future work: making more of our code available to tracing, additional optimizations

  • self-hosting the DOM
  • escape analysis and allocation removal

Tracing beyond JavaScript: can we apply tracing techniques to other areas of code?

Further reading: