module Benchmark::IPS
def ips_quick(*methods, on: Kernel, **opts)
- Example: Compare two methods you just defined, with a custom warmup. -
Example: Compare String#upcase and String#downcase -
Options Hash:
(**opts)
-
:time
(Integer
) -- The number of seconds to run the benchmark. -
:warmup
(Integer
) -- The number of seconds to warm up the benchmark.
Parameters:
-
opts
(Hash
) -- Additional options for customizing the benchmark. -
receiver
(Object
) -- The object on which to call the methods. Defaults to Kernel. -
methods
(Symbol...
) -- A list of method names (as symbols) to compare.
def ips_quick(*methods, on: Kernel, **opts) ips(opts) do |x| x.compare! methods.each do |name| x.report(name) do |iter| iter.times { on.__send__ name } end end end end