Sha256: 71963642886f64bc32321989a4a60d8bad5bdac55f508047b8d1712553e1341a

Contents?: true

Size: 478 Bytes

Versions: 2

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

require "much-mixin"
require "benchmark"

module Methods; end

module MyMixin
  def self.included(receiver)
    receiver.class_eval{ include Methods }
  end
end

module MyMuchMixin
  include MuchMixin

  mixin_included do
    include Methods
  end
end

Benchmark.bmbm do |x|
  x.report("MyMixin") do
    10_000.times{ Class.new{ include MyMixin } }
  end
  x.report("MyMuchMixin") do
    10_000.times{ Class.new{ include MyMuchMixin } }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
much-mixin-0.2.5 bench/script.rb
much-mixin-0.2.4 bench/script.rb