Sha256: 3d32299dca09eeec69959c256d42dba986abf51b6e635f7ead90117cc891cb5a

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

# Benches

Benches defines a simple benchmarking DSL that allows you to create benchmark routines for your Ruby code.

## Defining a Routine

Create a folder called regimens. For each class that you want to benchmark,
create a file like integer.rb

integer_routine.rb
```ruby
routine 4, 'benches 400 reps of to_s' # no arguments
routine 30, 'benches 300 reps of * with (400)' # one argument
routine 'test_string', "benches 500 reps of gsub with (s, '')" # two arguments
```

This will return the benchmark results of running `4.to_s` 400 times,
`30 * 400` 300 times, and `'test_string'.gsub('s', '')` 500 times.

The command `benchpress` will run all of the regimens.

## Testing

Simply run `rspec` to run the test suite.

## Future Work

- Allow benchmark results to be tested in block passed to routine

## Credits

All code (c) Evan Hemsley 2014

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
benches-0.1.0 README.md