Sha256: befca72a2b28e1d5c1231b5f62638c66824a821002800a5389db22eee1ff2afb

Contents?: true

Size: 441 Bytes

Versions: 3

Compression:

Stored size: 441 Bytes

Contents

require 'much-plugin'
require 'benchmark'

module Methods; end

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

module MyPlugin
  include MuchPlugin

  plugin_included do
    include Methods
  end
end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
much-plugin-0.2.2 bench/script.rb
much-plugin-0.2.1 bench/script.rb
much-plugin-0.2.0 bench/script.rb