non/spire — pull request #307 by ijuma (2014-09-20 19:30:57+00:00)
Title: WIP: JMH benchmarks

This is an initial PR to start a discussion regarding the approach. My plan was to be conservative and port the existing benchmarks to JMH in a separate subproject called benchmark-jmh that depends on the `benchmark` subproject (for code reuse).

To run the benchmarks, one can do `benchmark-jmh/run`. See https://github.com/ktoso/sbt-jmh for more details about the sbt-jmh plugin. Note that it also includes JMH samples, which may be a good way to get an idea of how it works.

Results from running it on my laptop:

```
Benchmark Mode Samples Score Score error Units
s.b.j.AddBenchmarks.addComplexesDirect avgt 30 1829.296 92.173 us/op
s.b.j.AddBenchmarks.addComplexesGeneric avgt 30 2230.329 140.297 us/op
s.b.j.AddBenchmarks.addDoublesDirect avgt 30 189.686 1.467 us/op
s.b.j.AddBenchmarks.addDoublesGeneric avgt 30 190.520 1.898 us/op
s.b.j.AddBenchmarks.addFastComplexes avgt 30 649.856 4.134 us/op
s.b.j.AddBenchmarks.addFloatsDirect avgt 30 191.667 1.385 us/op
s.b.j.AddBenchmarks.addFloatsGeneric avgt 30 192.435 1.365 us/op
s.b.j.AddBenchmarks.addIntsDirect avgt 30 64.146 0.398 us/op
s.b.j.AddBenchmarks.addIntsGeneric avgt 30 63.780 0.363 us/op
s.b.j.AddBenchmarks.addLongsDirect avgt 30 68.989 1.163 us/op
s.b.j.AddBenchmarks.addLongsGeneric avgt 30 70.461 1.837 us/op
s.b.j.AddBenchmarks.addMaybeDoublesDirect avgt 30 5588.012 91.623 us/op
```