View The Space is Hiring

Monday, December 5, 2011

ruby-prof within cucumber

We've all been there... slow cucumber tests. It's tough to know where to begin. Recently, I added the ability to enable ruby-prof for a cucumber run. I added the following file to our features/support directory:

Then to run cucumber with ruby prof enabled:

RUBY_PROF=true cucumber features/tourbooks.feature

After cucumber finishes, profile-flat.txt and profile-graph.html should exist in the rails root tmp directory.


  1. took 6 minutes to generate the flat file, nearly 27 minutes for a calltree output. I ran out of patience for the graphhtml.....

    is this normal ? same for you?
    or is this an indication of something?

    result in the flat file shows the addressable gem to be the most expensive, which is very surprising to me...

  2. It does take a while, but 27 minutes is not normal.