Hannes Wallnoefer a écrit :
> On 12 Feb., 14:45, Christophe Grand <[EMAIL PROTECTED]> wrote:
>> Does someone have already profiled some (compiled) js code?
>>
> 
> It's pretty easy to build a basic profiler (such as how much time was
> spent in how many invocations of what function) using Rhino's debugger
> interface. Just implement org.mozilla.javascript.debug.Debugger and
> register an instance with Context.setDebugger() [1]. The Debugger
> instance will then get notified when scripts/functions are entered and
> left. All you have to do is collect/sort/output that data in whatever
> way suits your needs.

Easy indeed. Thanks.

> One downside is that it only works in interpreter mode, with the
> compiler disabled. However, interpreter mode is not that much slower
> than compiled mode, so it should be possible to use even in a
> production environment.

BTW, I have always found the interpreted mode really slower, so your 
claim made me run a quick benchmark (wgeting many times a single page) 
and in interpreted mode it seems to take only 50% more time to complete 
than in compiled mode... if I omit the first run (on 16384 runs) which 
is always 15x slower (time to JIT the interpreter? I don't think so: the 
application initialization is only 50% slower).

Christophe
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to