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

**URL:** <https://rubytalk.org/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/53249>\
**Category:** ruby-talk\
**Created:** [6 May 2009 11:57 UTC](https://rubytalk.org/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/53249 "2009-05-06T11:57:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shot\_Piotr\_Szotkowsk](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@Shot\_Piotr\_Szotkowsk](https://rubytalk.org/u/Shot_Piotr_Szotkowsk)\
**Post date:** [6 May 2009 11:57 UTC](https://rubytalk.org/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/53249/1 "2009-05-06T11:57:11Z")

</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

> **···**
>
> --  
> stay-at-home executives vs. wallstreet dads [kodz]

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [6 May 2009 19:12 UTC](https://rubytalk.org/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/53249/2 "2009-05-06T19:12:26Z")

</div>

Shot (Piotr Szotkowski) 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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [7 May 2009 07:19 UTC](https://rubytalk.org/t/how-to-profile-ruby-1-9-and-or-jruby-code-ruby-prof-works-only-on-mri-ruby-1-8/53249/3 "2009-05-07T07:19:14Z")

</div>

Shot (Piotr Szotkowski) 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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
