The benchmark code for the posts Stream Performance and Stream Performance - Your Ideas. Read them for details on the setup. The results are gathered in this Google Spreadsheet.
For the first post, benchmarks are split into three classes that cover operations of different complexity:
SimpleOperationsBenchmark
: integer comparison and additionMediumOperationsBenchmark
: a handful of multiplicationsComplexOperationsBenchmark
: object creation and string manipulation
And for the second post:
CommentOperationsBenchmark
: benchmarks according to your ideas
To tweak how the benchmarks are executed take a look into their superclass AbstractIterationBenchmark
.