Skip to content

Instantly share code, notes, and snippets.

@sreeix
Created October 10, 2011 14:06
Show Gist options
  • Select an option

  • Save sreeix/1275411 to your computer and use it in GitHub Desktop.

Select an option

Save sreeix/1275411 to your computer and use it in GitHub Desktop.
test for custom benchmarking
class Foo
include CustomBenchmarking
def bar
print '.'
end
benchmarking :bar
end
puts ObjectSpace.count_objects
1000000.times {|x| Foo.new.bar}
puts GC::Profiler.report
puts ObjectSpace.count_objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment