Last active
December 15, 2015 19:09
-
-
Save jamesgolick/5308637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[james@kremlin00 ruby (klasscache)]$./ruby -I . -I lib ./test.rb | |
method cache invalidations: 18 | |
A | |
B | |
method cache invalidations: 18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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