Skip to content

Is there a way to profile Javascript executed with Rhino? #1027

Answered by p-bakker
jonbartels asked this question in Q&A
Discussion options

You must be logged in to vote

To my knowledge there isn't a stand-alone profiler implementation for Rhino, neither is there a standard for generic Profiler implementations (similar to the Debug Adapter Protocol for debugging) that allows you to plugin a runtime like Rhino into an IDE and be able to profile a runtime using a standardized Profiling UI.

So, if you want a proper profiler, I think you'd have to create one yourself.

The basic structure of an implementation would be something like: implement the org.mozilla.javascript.debug.Debugger interface and register it as debugger on your context using Context cx.setDebugger(...);

In your org.mozilla.javascript.debug.Debugger.getFrame() implementation you can then reco…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jonbartels
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants