Sha256: 69e9902aaf6a43ef6c1e202fdbbc7eea0832d46822a2f7b23b69e663037e2c49

Contents?: true

Size: 317 Bytes

Versions: 21

Compression:

Stored size: 317 Bytes

Contents

require 'benchmark'
require 'rspec/expectations'
include RSpec::Matchers

n = 1_000_000
matcher = eq(3)

Benchmark.bm do |x|
  x.report do
    n.times { matcher.clone }
  end
end

__END__

We can do about 1000 clones per ms:

      user     system      total        real
  1.080000   0.030000   1.110000 (  1.120009)

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
opal-rspec-1.1.0.alpha3 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-1.1.0.alpha2 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-1.1.0.alpha1 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-1.0.0 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-1.0.0.alpha1 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.8.0 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.8.0.alpha3 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.8.0.alpha2 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.8.0.alpha1 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.7.1 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.7.0 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.6.2 rspec-expectations/benchmarks/cloning_matchers.rb
opal-rspec-0.7.0.rc.2 rspec-expectations/upstream/benchmarks/cloning_matchers.rb
opal-rspec-0.6.1 rspec-expectations/benchmarks/cloning_matchers.rb
opal-rspec-0.6.0 rspec-expectations/benchmarks/cloning_matchers.rb
opal-rspec-0.6.0.beta1 rspec-expectations/benchmarks/cloning_matchers.rb
opal-connect-rspec-0.5.0 rspec-expectations/benchmarks/cloning_matchers.rb
opal-rspec-0.5.0 rspec-expectations/benchmarks/cloning_matchers.rb
opal-rspec-0.5.0.beta3 rspec-expectations/benchmarks/cloning_matchers.rb
opal-rspec-0.5.0.beta2 rspec-expectations/benchmarks/cloning_matchers.rb