I’ve found myself on a benchmarking kick these last couple of weeks. Sometime last week, I dug up the library written by . Pistos’ library is basically just a wrapper for the , which is more or less an interface to (similar to what is to ).
Combining these tools together, we can do some pretty nifty code performance analysis in very few lines of code, e.g.
require 'rubygems' require 'better-benchmark' result = Benchmark.compare_realtime(:iterations => 10) { |iteration| save_the_world() }.with { |iteration| save_the_world_and_save_the_girl() } Benchmark.report_on result
I have and wrapped the library up into a .