This file contains hidden or 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
# Subclass of Module, used for storing methods copied from other | |
# modules and classes. This lets classes shuffle their methods off | |
# into a module to we can place other modules in front of the | |
# class's own methods | |
class StashModule < Module | |
class << self | |
def [](id) | |
@modules[id] | |
end | |
This file contains hidden or 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
require "rubygems" | |
require "rbench" | |
RBench.run(500) do | |
report("memoed") do | |
Foo.memoed("hello") | |
end | |
report("unmemoed") do | |
Foo.unmemoed("hello") | |
end |