ruby-prof 0.7.0

Posted by Charlie Wed, 12 Nov 2008 16:41:00 GMT

I'm happy to announce the release of ruby-prof 0.7.0, the superfast, open-source, Ruby profiler that helps you find bottlenecks in your Ruby code. This release was a joint effort, with major contributions from Jeremy Kemper (aka bitsweat) of Rails fame and Hin Boen from CodeGear. There are two major new features in this release, as well as a number of smaller enhancements and bug fixes. For a full list of changes, take a look at the release notes.

The first major new feature is improved Rails profiling, which I'll talk about in a separate post.

The second major feature is significant internal changes that make it easier to integrate ruby-prof with IDEs. ruby-prof is already being used by Aptana's RadRails and has been integrated into the next version of Code Gear's 3rd Rail. As part of this work, Hin has built a user interface for ruby-prof that lets a user inspect individual methods to see how much time they took as well as how they were called.

One big problem though, previous versions of ruby-prof only kept track of aggregate data. This made it impossible for Hin to create the user interface he wanted. For example, look at this call sequence:

     A
/ \
B K
/ \ \
C D B
/ \
C D

With earlier versions of ruby-prof, there was no way to tell what percent of the time spent in method C was a result of the A -> B -> C call sequence versus the A -> K -> B -> C call sequence.

Or take another example:

  A    K
| |
B B
| |
C D

In this case, if you tried to reconstruct the call sequence from ruby-prof you would end up with this incorrect result:

     A    K
| /
B
/ \
C D

So working with Hin, I rearchitected ruby-prof to keep track of full call sequences. Most likely you won't notice any difference - the changes will only affect you if you use ruby-prof's api to present results in a custom way. In that case, you'll have to update your code, which should only take a few minutes (to see the api in use, take a look at the various printer classes that ship with ruby-prof).

Enjoy, and all feedback is welcome.

Posted in  | 3 comments | no trackbacks

Comments

  1. Avatar Chess said about 6 hours later:

    We need Netbeans to be included in the IDE support!

  2. Avatar Radarek said 2 days later:

    Thanks for such a great tool!

    During some tests with ruby-prof I found some problem. I filed an issue: http://rubyforge.org/tracker/?func=detail&aid=22804&group_id=1814&atid=7060

  3. Avatar Charlie said 2 days later:

    Hi Radarek,

    Thanks for the report - will answer on RubyForge.

Trackbacks

Use the following link to trackback from your own site:
http://cfis.savagexi.com/trackbacks?article_id=503

Comments are disabled