melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
662 stars 88 forks source link

"Hello World" example #169

Open ian-bertolacci opened 3 years ago

ian-bertolacci commented 3 years ago

I'm newish to the Java space but need to get up and running using JMH in gradle. I'm having a world of trouble getting JMH to work for even simple projects, and the fact that there are no standalone examples provided by this project make putting the pieces together really difficult.

For example, I'm at a loss as to what actually goes in what sections of my gradle file, because the Readme only includes snip-its here and there, with vague references to location and scope. This is complicated by many online write-ups which use this plug-in in more complicated pre-developed projects, and so their examples are often very unclean, and make no delineation between parts of the build script that are required for JMH and/or the JMH plug-in, and often does not explain what parts are necessary for a simple base execution of JMH or are required for some more complex reason.

I highly suggest putting in at least one example demonstrating a simple gradle build using the JMH plug-in. It should be extremely bare-bones, and each statement should be relatively well explained. Other examples would then expand on the other functionality provided by the plug-in.

melix commented 3 years ago

I have added a samples folder, with just one simple example for now: https://github.com/melix/jmh-gradle-plugin/tree/master/samples