How to profile JRuby code?

2019-02-03 04:52发布

I'd like to profile my JRuby app. For MRI I always use ruby-prof, but I don't think this works on JRuby. I don't want to use a Java-profiler, because it won't give me the ruby line numbers.

Is there a jruby-prof?

4条回答
冷血范
2楼-- · 2019-02-03 05:04

JRuby 1.5.5 includes a decent --profile command line flag.

Use it like this:

jruby --profile -S <script> <args>
查看更多
贪生不怕死
3楼-- · 2019-02-03 05:07

Check out Daniel Lucraft's new jruby-prof

查看更多
做自己的国王
5楼-- · 2019-02-03 05:21

We have never received a request for line numbers because that is typically only ever used when performing call stack sampling but I would see whether we can turn this on as an option. But for the most part you will not have to work because our automatic hotspot detection and extensible metering solutions would find the issue whether in the ruby code or the jruby implementation.

archive.org: http://williamlouth.wordpress.com/2009/08/05/the-fastest-ruby-profiler-is-a-java-profiler/

查看更多
登录 后发表回答