Rails Modeling Methods

Is there something similar to Ruby Benchmark in Rails? I used to use the Ruby test to compare different bits of code, but none of them were related to Rails. I would like to use my application models in some benchmarking to do something in accordance with ...

#!/usr/bin/ruby require 'benchmark' Benchmark.bmbm do |x| x.report("Benchmark 1") do 1_000_000.times do # do something here... end end x.report("Benchmark 2") do 1_000_000.times do # Do something else here... end end end 

Which gives me some conclusion:

 Rehearsal ----------------------------------------------- Benchmark 1 0.070000 0.000000 0.070000 ( 0.069236) Benchmark 2 0.070000 0.000000 0.070000 ( 0.069227) -------------------------------------- total: 0.140000sec user system total real Benchmark 1 0.070000 0.000000 0.070000 ( 0.069793) Benchmark 2 0.070000 0.000000 0.070000 ( 0.069203) 

I looked at script / performance / benchmarker and script / performance / profiler but could not find a way to compare the methods. I also studied this as part of the test, but I do not have any statements, so it did not make sense.

+6
benchmarking ruby ruby-on-rails
source share
1 answer

Testing the performance of your rails application may be all you need. I think that everything you can do with standalone Rails.

+5
source share

All Articles