ruby-prof and KCachegrind

Some of our code has been slow for a while. Now that we are importing more sites its come to a point where profiling and optimizing is a necessity.
ruby-prof is a great tool for profiling your ruby code. For instance I can do the following:
SITE=mysite ruby-prof -p call_tree -f ~/s3/doc/profile/mysite_importing_call_tree.kcg convert.rb
That will output a call tree file that can be read by another great program: KCachegrind. KCachegrind helps you sort and visualize what is taking up the most time. In the screenshot attached you can see that Kernel::clone takes up 5% of the whole process.
Read more about ruby-prof Read more about KCachegrind

Picture
Share:
  • del.icio.us
  • Reddit
  • Technorati
  • Twitter
  • Facebook
  • Google Bookmarks
  • HackerNews
  • PDF
  • RSS
This entry was posted in Uncategorized. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">