Skip to content

Instantly share code, notes, and snippets.

@jamesgolick
Last active December 15, 2015 19:09
Show Gist options
  • Save jamesgolick/5308637 to your computer and use it in GitHub Desktop.
Save jamesgolick/5308637 to your computer and use it in GitHub Desktop.
[james@kremlin00 ruby (klasscache)]$./ruby -I . -I lib ./test.rb
method cache invalidations: 18
A
B
method cache invalidations: 18
class A
def a
puts 'A'
end
end
module B
def a
puts 'B'
end
end
puts "method cache invalidations: #{RubyVM::MethodCache.invalidations}"
A.new.a
class A
def a
puts 'B'
end
end
A.new.a
puts "method cache invalidations: #{RubyVM::MethodCache.invalidations}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment