Sha256: e4ac801e4b7c2768b791165c18cc6de4667c287263b3ea7ebb5df2c078f3b170

Contents?: true

Size: 905 Bytes

Versions: 1

Compression:

Stored size: 905 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_regimen.rb

integer_regimen.rb
```ruby
subject 5 do
  benches '500 reps of to_s in less than 5 seconds'
  benches '400 reps of + in less than 2 seconds', 3
  benches '300 reps of * in less than 3 seconds', 400
end

subject 20 do
  benches '500 reps of to_s in less than 5 seconds'
  benches '400 reps of + in less than 2 seconds', 3
  benches '300 reps of * in less than 3 seconds', 400
end
```

If the benchmarks runs within the allotted time, it will
be printed green, otherwise it will be printed red.

The command `benchpress` runs all of the regimen files

## Testing

Simply run `rspec` to run the test suite.

## Credits

All code (c) Evan Hemsley 2014

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
benches-0.2.0 README.md