"Qu0ll" <Qu**********@gmail.comwrites:
[3rd attempt]
At?
In browsers which utilise a JIT JavaScript compiler, are there any
factors that may prevent a script from being compiled before it is
executed?
That's far too generalt a question to answer.
In TraceMonkey (for Firefox), nothing guarantees it's compiled before
it's executed the first time, but if it is executed often enough, a
trace will be build and that trace is compiled.
In V8 (currently in Google Chrome), all source code is compiled before
execution, there is no interpreter.
I don't know exactly what Squirrelfish Extreme (for Safari) does.
I don't see any reason why this would be so but I would
like to check that scripts that access Java classes & methods and/or
scripts which are loaded dynamically using AJAX will both be valid
candidates for jittering.
I'd guess they are even. What might hurt you is any code that is not
predictable, i.e., anything using "eval" (since it might change its
surrounding scope, and cannot generally be compiled before the call)
or inside a "with" statement (which makes the variable lookup
unpredictable).
Don't use either in a function that you want to be fast.
This might affect you if you create function dynamically usig AJAX and
eval.
/L
--
Lasse Reichstein Nielsen
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'