Skip to content

Instantly share code, notes, and snippets.

@ebeigarts

ebeigarts/bm2.rb Secret

Created December 14, 2017 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebeigarts/c160f9cf698b5d5e31685deeb50b5cb3 to your computer and use it in GitHub Desktop.
Save ebeigarts/c160f9cf698b5d5e31685deeb50b5cb3 to your computer and use it in GitHub Desktop.
require 'bundler/setup'
require 'benchmark/ips'
require 'active_support/descendants_tracker'
class Parent
extend ActiveSupport::DescendantsTracker
end
Benchmark.ips do |x|
x.warmup = 1
x.report("Class.new") { Class.new(Parent) }
x.compare!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment