Search code examples
ruby-on-railsperformancerspecbenchmarking

Rails: Performance benchmarking using RSPec


I'm just coming across to RSpec from rake:test, and I'm struggling to find any equivalent to rake test:benchmark and/or rake test:profile.

So, what do most rspec folks use for performance testing? I've found --profile, which spits back the ten slowest tests, but I was hoping for something a little more comprehensive.

Cheers...


Solution

  • The Diaspora project took an interesting approach to performance testing with rspec -- tests that say "this method should be fast / take less than N ms"

    https://github.com/diaspora/diaspora/blob/a6f8b2c14ed7ec13f2ecd113ae809a072814ab50/spec/controllers/aspects_controller_spec.rb#L92

    Different than the typical approach but implementable without any half-baked rspec plugins