Sha256: 96f7b0750f8d11aea2df00bbb8030ebacfc26bf733840bfd9f01e192c03d9279

Contents?: true

Size: 235 Bytes

Versions: 19

Compression:

Stored size: 235 Bytes

Contents

require 'benchmark/driver'

class Array
  alias_method :blank?, :empty?
end

Benchmark.driver(runner: :call) do |x|
  array = []

  x.report('array.empty?') { array.empty? }
  x.report('array.blank?') { array.blank? }
  x.compare!
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
benchmark_driver-0.8.6 examples/call_blank.rb
benchmark_driver-0.8.5 examples/call_blank.rb
benchmark_driver-0.8.4 examples/call_blank.rb
benchmark_driver-0.8.3 examples/call_blank.rb
benchmark_driver-0.8.2 examples/call_blank.rb
benchmark_driver-0.8.1 examples/call_blank.rb
benchmark_driver-0.8.0 examples/call_blank.rb
benchmark_driver-0.7.2 examples/call_blank.rb
benchmark_driver-0.7.1 examples/call_blank.rb
benchmark_driver-0.7.0 examples/call_blank.rb
benchmark_driver-0.6.2 examples/call_blank.rb
benchmark_driver-0.5.1 examples/call_blank.rb
benchmark_driver-0.5.0 examples/call_blank.rb
benchmark_driver-0.4.5 examples/call_blank.rb
benchmark_driver-0.4.4 examples/call_blank.rb
benchmark_driver-0.4.3 examples/call_blank.rb
benchmark_driver-0.4.2 examples/call_blank.rb
benchmark_driver-0.4.1 examples/call_blank.rb
benchmark_driver-0.4.0 examples/call_blank.rb