PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [Global] Firefox: Neue JavaScript-Engine wohl die schnellste



hl2.exe
26.10.2010, 22:17
Für Firefox 4.0 arbeiten die Entwickler aus dem Hause Mozilla an einer Erweiterung der JavaScript-Engine namens "Jägermonkey". Jetzt haben sie damit einen neuen Rekord im JavaScript-Benchmark SunSpider aufgestellt.

Laut Mozilla-Entwickler Asa Dotzler konnte man sogar Googles JavaScript-Engine V8 aus Chrome sowie Apples Nitro aus Safari schlagen. Wie man der Verlaufsgrafik entnehmen kann, gelang dieser Erfolg etwa Mitte Oktober. Die Arbeiten an Jägermonkey werden unterdessen fortgesetzt.

http://screenshots.winfuture.de/Jaegermonkey-Benchmark-1288097704.jpg
Jägermonkey nutzt die bewährten Methoden der aktuellen JavaScript-Engine Tracemonkey, erweitert diese aber um einige Neuerungen. Sobald auf einer Website das Tracing zum Einsatz kommen kann, ist Firefox noch heute der Konkurrenz überlegen. Allerdings ist das nicht immer möglich, weshalb man mit Jägermonkey auf die Übersetzung kompletter JavaScript-Methoden in Assembler setzt. Firefox 4.0 wird in jedem Fall neu entscheiden, ob das Tracing schneller ist und es in diesem Fall einsetzen. Falls nicht, nutzt man die Assembler-Übersetzung.

http://screenshots.winfuture.de/Jaegermonkey-Benchmark-1288097744.jpg
Um zu zeigen, dass man tatsächlich Fortschritte gemacht hat und auch mit Googles Browser Chrome mithalten kann, hat man auch den JavaScript-Benchmark von Google herangezogen. Hier liegt Chrome zwar noch etwas in Führung, doch Firefox mit Jägermonkey konnte sich bereits deutlich annähern. Auf AreWeFastYet.com (http://arewefastyet.com/) kann man beobachten, wie die Entwicklung voranschreitet. Quelle: WinFuture.de (http://winfuture.de/news,59056.html)

EBFE
26.10.2010, 22:49
Naja, bis jetzt wurde Tracing-JIT Technik angewendet:
(Prinzip: )




programs spend most of their runtime in loops
several iterations of the same loop are likely to take similar code paths
the best way to gain information about the behaviour of a program is to observe it

The basic approach of a tracing JIT is to only generate machine code for commonly executed loops and to interpret the rest of the program. The code for those common loops however should be highly optimized, including aggressive inlining.When in tracing mode, the interpreter records a history (the trace) of all the operations it executes, in addition to actually performing the operations. During tracing, the trace is repeatedly checked whether the interpreter is at a position in the program that it had seen earlier in the trace. If this happens, the trace recorded corresponds to a loop in the program that the tracing interpreter is running. At this point, this loop is turned into machine code by taking the trace and making machine code versions of all the operations in it.Das funktioniert auch recht gut bei PyPy oder Lua. Allerdings sind die JavaScripts doch eher ereignissorientiert - und da kommt das "normale"/"alte" Loop-Profiling doch an seine Grenzen :)

Wer mehr dazu lesen möchte:
http://rayli.net/blog/2010/04/what-are-the-benefits-of-a-tracing-jit/
http://en.wikipedia.org/wiki/Trace_tree