0.0
No commit activity in last 3 years
No release in over 3 years
Benchmark Garbage Collect stats relevant to memory optimization.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.14
~> 10.0
 Project Readme

BenchmarkGC

A lightweight gem for benchmarking garbage collect stats relevant to memory optimization.

Installation

Add this line to your application's Gemfile:

gem 'benchmark_g_c'

And then execute:

$ bundle

Or install it yourself as:

$ gem install benchmark_g_c

Usage

class Thing
  include BenchmarkGC

  # A method you want to benchmark
  def method_name
    do_some_stuff
  end

  # Add this method in order to benchmark (name doesn't matter)
  def check
    bcheck { method_name }
  end
end

In a console:

Thing.new.check

Parameter options (all are optional):

  • name: (string) Print the name of the benchmarked code
  • times: (integer) Number of times to run the benchmarked code in succession
  • logger: (boolean) ActiveRecord::Base.logger should log

bcheck returns the value of the benchmarked code, making this possible:

class Thing
...
  def method_name
    bcheck { do_some_stuff }
  end
end

Now you can run any code that uses method_name, and method_name will get benchmarked each time it is run.

License

The gem is available as open source under the terms of the MIT License.