0.0
No commit activity in last 3 years
No release in over 3 years
Provides benchmark helper methods for easier measuring
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.4
~> 3.3

Runtime

~> 0.9.10
 Project Readme

pry-measure

Build Status

Adds pry-measure command for quick adhoc benchmarking.

Installation

gem install pry-measure

or added to the Gemfile:

gem 'pry-measure'

Helper methods

A pry_measure helper method is added which takes arguments for number of times to execute and number of times to run (both default to just 1):

pry(main)> pry_measure(2, 200000) do
pry(main)*   10.times do |time|; 1000*1000*1000*1000; end
pry(main)* end
       user     system      total        real
   0.230000   0.000000   0.230000 (  0.234847)
   0.230000   0.000000   0.230000 (  0.228060)
=> [#<Benchmark::Tms:0x007fd992bd2b30 ...>, #<Benchmark::Tms:0x007fd992bd2220 ...>]

Additionally, time_method is added:

pry(main)> time_method String, 'new', 'FooBar'
Time elapsed 0.004 milliseconds

Pry Command Usage

pry-measure -t 10 #{`curl http://google.com`}

The above passes the interpolated code to Benchmark.measure to be evaluated 10 times. Upon completion the command returns a results hash with the average times:

=> {
  :real => 0.1958,
  :utime => 0.0,
  :stime => 0.002,
  :total => 0.056
}