Sha256: 087d19661bfd19fc148b24ccfdcb3458c7f0dbcc5a5cab3b1cfa27b2a13ce493

Contents?: true

Size: 451 Bytes

Versions: 3

Compression:

Stored size: 451 Bytes

Contents

require "test_helper"
require "uber/options"
require "uber/option"
require "benchmark/ips"

proc = ->(options) { "great" }

value  = Uber::Options::Value.new(proc)
option = Uber::Option[proc, instance_exec: true]

Benchmark.ips do |x|
  x.report(:value)  { value.(self, {}) }
  x.report(:option) { option.(self, {}) }
end

#  value    946.110k (± 2.4%) i/s -      4.766M in   5.040395s
# option      1.583M (± 1.6%) i/s -      7.928M in   5.009953s

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/uber-0.1.0/test/builder-benchmark.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/uber-0.1.0/test/builder-benchmark.rb
uber-0.1.0 test/builder-benchmark.rb