Post by Peter Cooper on July 25th, 2007

How to Profile Your Rails Application and Make Rails Go Vroom!

Call Graph-1
Charlie Savage, author of ruby-prof, recently baked in support for Rails to ruby-prof, so now it's possible to profile your Rails application, see where the delays are, and work on improving performance.

Hot on the heels of this development, Charlie wrote "How to Profile Your Application", an article that does just what it says on the tin, and which demonstrates how to profile the CPU time used on a single Rails request, and visualize the call tree.

This was quickly followed up with "Making Rails Go Vroom", another great article that looks at what parts of Rails significantly slow things down. Charlie comes up with six key suggestions:

  • Don't use ActiveRecord#attributes or ActiveRecord#read_attribute
  • Get your :includes right
  • Don't check template timestamps ( cache_template_loading = true)
  • Don't use url_for
  • Don't let Rails parse timestamps
  • Don't symbolize keys (local_assigns_support_string_keys = false)

Learn more and see how Charlie came to his conclusions in the article.

One Response to “How to Profile Your Rails Application and Make Rails Go Vroom!”

  1. #1
    blogwi.se Says:

    How-to Profile your Ruby (on Rails) Application

    Our current project is by far not yet in the state where we can and want to profile itÂ’s overall performance, but considering its current pace, we might be there in a couple weeks and therefore this post also is meant to be a little reminder for mysel...