Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Profiling JavaScript

180 views
Skip to first unread message

Simon Kaegi

unread,
Jun 9, 2010, 10:37:55 PM6/9/10
to
We've added support for debugging Rhino in Eclipse JSDT however we're now
being asked about support for profiling your JavaScript running under Rhino.

Is anyone aware of any previous work done with Rhino to support JavaScript
"profiling"?
Is there any support built into Rhino that we might be able to build our own
"timing"support on?
Thanks.

-Simon


Simon Kaegi

unread,
Jun 9, 2010, 10:49:11 PM6/9/10
to
To be clear we're interested in profiling non-interpreted mode JavaScript
and am looking for any hooks we might be able to use

Attila had suggested an approach using the debugger interfaces and we could
certainly write something to work here however it's not clear to me if
that's of any value. Would anyone be interested in profiling Rhino in
interpreted mode?

-Simon

"Simon Kaegi" <simon...@ca.ibm.com> wrote in message
news:8Jqdnbz0x-WYzY3R...@mozilla.org...

Cameron McCormack

unread,
Jun 10, 2010, 1:12:36 AM6/10/10
to
Hi Simon.

On 10/06/2010 12:49 PM, Simon Kaegi wrote:
> To be clear we're interested in profiling non-interpreted mode JavaScript
> and am looking for any hooks we might be able to use

So if you're running compiled code, do you really need anything
Rhino-specific? What do you need that you don't get out of the regular
information that JVMTI provides?

(Note that I've never written anything that uses JVMTI; but I do profile
my compiled-with-Rhino JS application with the YourKit profiler. As
long as I give my anonymous functions suitable names so that I can
identify them, I've been happy enough profiling my application as if it
were any old regular Java app.)

Cameron

Johan Compagner

unread,
Jun 10, 2010, 4:38:51 AM6/10/10
to Simon Kaegi, dev-tech-js-...@lists.mozilla.org
We use the DebugFrame (onEnter/onExit) to track method calls and timings

> _______________________________________________
> dev-tech-js-engine-rhino mailing list
> dev-tech-js-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
>

Jürg Lehni

unread,
Jun 10, 2010, 5:10:47 AM6/10/10
to Simon Kaegi, dev-tech-js-...@lists.mozilla.org
I know that Hannes Wallnoerfer has done some impressive work for a profiler in RingoJS:

http://ringojs.org/wiki/

He is also on this list and will probably be able to tell you more.

Jürg

Hannes Wallnoefer

unread,
Jun 11, 2010, 6:21:48 AM6/11/10
to
On Jun 10, 11:10 am, Jürg Lehni <li...@scratchdisk.com> wrote:
> I know that Hannes Wallnoerfer has done some impressive work for a profiler in RingoJS:
>
> http://ringojs.org/wiki/
>
> He is also on this list and will probably be able to tell you more.

Well, we have a simple profiler in Ringo, but it's also based on the
debugger interface and hence doesn't work on compiled code:

http://github.com/ringo/ringojs/blob/master/modules/ringo/profiler.js

I think it would actually be nice to be able to profile optimized
Rhino code. The full debugger interface is probably too heavy to
implement in optimized code, but maybe we could implement a reduced
interface optimized for tracing and profiling that only calls on
function enter/exit but not line change number? I have no idea how
hard that would be, but I can look into it the next time I spend some
time with Rhino bytecode generation.

Hannes

> Jürg
>
> On 10 Jun 2010, at 03:37, Simon Kaegi wrote:
>
> > We've added support for debugging Rhino in Eclipse JSDT however we're now
> > being asked about support for profiling your JavaScript running under Rhino.
>
> > Is anyone aware of any previous work done with Rhino to support JavaScript
> > "profiling"?
> > Is there any support built into Rhino that we might be able to build our own
> > "timing"support on?
> > Thanks.
>
> > -Simon
>
> > _______________________________________________
> > dev-tech-js-engine-rhino mailing list

> > dev-tech-js-engine-rh...@lists.mozilla.org
> >https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

0 new messages