views:

255

answers:

2

Is it possible to detect that a Firefox browser is running the TraceMonkey JavaScript interpreter? If so, is it possible to do it with JavaScript? A solution which involves examining the browser binary or shared libraries is also OK for me. I'm running Linux with Firefox 3.0.14 right now.

+3  A: 
  1. enter "about:config" as URL
  2. say you will be careful
  3. search "JIT"

you can check if it's enabled by looking at:

javascript.options.jit.chrome -> for browser UI and plugins

javascript.options.jit.content -> for web content

(you can also change the values)

btw. if your code is a little complex don't expect to get a speed comparable to V8. Tracemonkey fails with branchy code (it may be slower than spidermonkey).

More info: http://hacks.mozilla.org/2009/07/tracemonkey-overview/

Pedro Ladaria
Thanks for the helpful answer. Only Firefox 3.5 has those JIT options, Firefox 3.0.14 doesn't have them. (It is enabled for content only.) Nevertheless, it doesn't make any difference for my JavaScript code either to turn JIT off in Firefox 3.5.2.
pts
Tracemonkey is only available for FF versions 3.5 and higher. But on dev versions 3.6 and 3.7 it's still very useless for not-to-complex code. Try to keep your loops as simple as possible to get the JIT benefits.
Pedro Ladaria
A: 

So, 3.0 doesn't have tracemonkey, and regarding your comment that in 3.5 it doesn't work either - are you maybe running distro-provided 64-bit? I recall reading that tracemonkey was disabled on 64-bit builds (the support was implemented only recently and is not in Firefox 3.5).

Nickolay