add benchmark for Module

This commit is contained in:
Watson
2014-01-27 09:37:38 +09:00
parent 25648dd1a7
commit f11dd74200
8 changed files with 100 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
def module_class_variable_set(x)
x.report "class_variable_set" do
100000.times do |i|
Foo.class_variable_set(:"@@foo#{i}", 42)
end
end
x.report "class_variable_set (included)" do
100000.times do |i|
Bar.class_variable_set(:"@@baz#{i}", 42)
end
end
end