# How to profile Ruby 1.9 and/or JRuby code? (ruby-prof works only on MRI Ruby 1.8)

**URL:** <https://www.ruby-forum.com/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/167293>\
**Category:** Ruby\
**Created:** [May 6, 2009, 1:57pm UTC](https://www.ruby-forum.com/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/167293 "2009-05-06T13:57:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [May 6, 2009, 1:57pm UTC](https://www.ruby-forum.com/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/167293/1 "2009-05-06T13:57:37Z")

</div>

I love ruby-prof, but it unfortunately does not work neither under  
MRI Ruby 1.9 nor under JRuby. How can one profile MRI Ruby 1.9  
and/or JRuby code?

(I can try backporting my code to Ruby 1.8.7, but itâ€™s additional work  
and I doubt profiling for Ruby 1.8.7 will consistently make the code run  
better under Ruby 1.9 and JRuby.)

â€” Shot

---

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [May 6, 2009, 9:12pm UTC](https://www.ruby-forum.com/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/167293/2 "2009-05-06T21:12:19Z")

</div>

Shot (Piotr S.) wrote:

> I love ruby-prof, but it unfortunately does not work neither under  
> MRI Ruby 1.9 nor under JRuby. How can one profile MRI Ruby 1.9  
> and/or JRuby code?

It appears from the ruby prof log that they _used_ to support 1.9 (till  
1.9 changed), so I’d probably fork their code and try to fix the compile  
errors in it.  
GL!  
-=r

---

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [May 7, 2009, 9:19am UTC](https://www.ruby-forum.com/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/167293/3 "2009-05-07T09:19:12Z")

</div>

Shot (Piotr S.) wrote:

> I love ruby-prof, but it unfortunately does not work neither under  
> MRI Ruby 1.9 nor under JRuby. How can one profile MRI Ruby 1.9  
> and/or JRuby code?

you can use ruby - prof on 1.9 but looks like you’ll have to check it  
out from SVN trunk to get it to compile 🙂

svn checkout svn://rubyforge.org/var/svn/ruby-prof

ref:  
[http://translate.google.com/translate?hl=en&sl=ja&u=http://d.hatena.ne.jp/hogelog/20090409/p1&ei=OYkCSunJEImEtgOiyeTjAQ&sa=X&oi=translate&resnum=2&ct=result&prev=/search%3Fq%3Druby%2Bprof%2Bprof\_event\_hook%2Bundeclared%26hl%3Den%26rlz%3D1C1GGLS\_enUS316US316](http://translate.google.com/translate?hl=en&sl=ja&u=http://d.hatena.ne.jp/hogelog/20090409/p1&ei=OYkCSunJEImEtgOiyeTjAQ&sa=X&oi=translate&resnum=2&ct=result&prev=/search%3Fq%3Druby%2Bprof%2Bprof_event_hook%2Bundeclared%26hl%3Den%26rlz%3D1C1GGLS_enUS316US316)

re: jruby profile not sure mayb repost to jruby mailing list?  
GL!  
-=r
