Profiling Your Application in Ruby
Profiling Ruby application is done with the help of Profile which you need to include in your application via “include ‘profile” command. Profiler will track all of the executions and method calls and record time it took for each to accomplish its tasks. It will display a detailed report after profiler is finished so that you can examine it for slow running processes and methods.
include ‘profiler’
Profiler will give you out of each method, time is took to run in seconds and number of calls to this method made during your application execution window.
Profiler comes handy when you try to stress test your application so that you can see where and what type of bottlenecks are present in your program. Please note that Ruby profiler is not some sort of complex piece of software, but rather rudimentary code base that tends to provide approximation of time for each method to run.