Martin Heller
Contributing Writer

Profiling Rails

analysis
Jul 9, 20083 mins

When I was comparing Rails IDEs, one of the things I looked at was profiling capabilities. The professional version of Aptana RadRails has a profiler; so does NetBeans. I didn't make too big a deal about profilers in IDEs, however, for two reasons: First, the Rails log tells you a lot about the response time of any given request; Second, an IDE profiler often can't tell you what's going on a production site, und

When I was comparing Rails IDEs, one of the things I looked at was profiling capabilities. The professional version of Aptana RadRails has a profiler; so does NetBeans.

I didn’t make too big a deal about profilers in IDEs, however, for two reasons: First, the Rails log tells you a lot about the response time of any given request; Second, an IDE profiler often can’t tell you what’s going on a production site, under real-world loads.

I wasn’t aware of it when I was writing my review (since the product was only released in June), but there’s a free profiler for Rails sites, FiveRuns TuneUp. According to the site, “FiveRuns TuneUp integrates powerful metric visualization together with the knowledge of the Rails community to let you Tune into your application’s profile.” The developer of TuneUp explains further in his blog:

TuneUp consists of two components; a developer panel plugin that you install in your applications for use in development, and the hosted TuneUp service where you can upload information about your app’s performance and share it with others.

The plugin adds a panel to the top of your application that displays information about how long it takes to execute an action, exactly what happened while it was executing, and how this compares with previous requests with the same URI. The information includes the filters that were called, model activity that occurred, and views that were rendered. You can see in-depth information about your database schema, SQL queries, and if you’re using MySQL (right now), EXPLAIN information on those queries. Everything’s contextual, so you can drill down and see exactly where things are happening… and even jump to the related line of code in TextMate.

How/Why would you use the TuneUp panel?

There are two core uses for the TuneUp panel. The first is simply as a casual source of information as you develop you application. It’s a handy tool to have around to tell you what’s happening in your action, and as a quick reference for schema information. It’s also a compelling way to incrementally improve performance, with basic metrics available at all times to prevent gradual response time creep, helping you see performance bottlenecks early. Premature optimization is the devil, but that doesn’t mean it makes sense to hide your head in the sand and stay ignorant of problems you’ll need to solve around the corner.

How about the service?

Sometimes you run into issues you don’t know how to resolve by yourself, or have information about the performance or makeup on an action that you’d like to share with others. The TuneUp panel includes an easy upload facility that lets you send the information on an action to http://tuneup.fiveruns.com, where you can make it public (or just send a quick link to someone).

Maybe you have a lot of Rails experience that could benefit others in the community. With more call stack and performance context to work from, it’s even easier for you to contribute your know-how to help other people solve problems. TuneUp is meant as a to be a service to the community, so get involved!

Martin Heller

Martin Heller is a contributing writer at InfoWorld. Formerly a web and Windows programming consultant, he developed databases, software, and websites from his office in Andover, Massachusetts, from 1986 to 2010. From 2010 to August of 2012, Martin was vice president of technology and education at Alpha Software. From March 2013 to January 2014, he was chairman of Tubifi, maker of a cloud-based video editor, having previously served as CEO.

Martin is the author or co-author of nearly a dozen PC software packages and half a dozen Web applications. He is also the author of several books on Windows programming. As a consultant, Martin has worked with companies of all sizes to design, develop, improve, and/or debug Windows, web, and database applications, and has performed strategic business consulting for high-tech corporations ranging from tiny to Fortune 100 and from local to multinational.

Martin’s specialties include programming languages C++, Python, C#, JavaScript, and SQL, and databases PostgreSQL, MySQL, Microsoft SQL Server, Oracle Database, Google Cloud Spanner, CockroachDB, MongoDB, Cassandra, and Couchbase. He writes about software development, data management, analytics, AI, and machine learning, contributing technology analyses, explainers, how-to articles, and hands-on reviews of software development tools, data platforms, AI models, machine learning libraries, and much more.

More from this author