Giter VIP home page Giter VIP logo

jmh-gradle-example's Introduction

Example using JMH with Gradle

An example project that uses JMH with Gradle, but without melix/jmh-gradle-plugin.

Usage

First, build a shadowJar of the project and benchmarks:

./gradlew clean :benchmark:shadowJar

Then run the benchmarks:

java -jar benchmarks/build/libs/benchmarks.jar

Running this on Oracle Java 1.8.0 u251:

Benchmark                    (size)  Mode  Cnt      Score      Error  Units
AdditionBenchmark.addLoop       100  avgt   20     32.703 ±    5.149  ns/op
AdditionBenchmark.addLoop      1000  avgt   20    326.507 ±   95.740  ns/op
AdditionBenchmark.addLoop     10000  avgt   20   2751.446 ±   30.586  ns/op
AdditionBenchmark.addStream     100  avgt   20    304.372 ±   56.959  ns/op
AdditionBenchmark.addStream    1000  avgt   20   2614.029 ±  440.807  ns/op
AdditionBenchmark.addStream   10000  avgt   20  23403.941 ± 1006.349  ns/op

Running this on GraalVM EE 19.3.1:

Benchmark                    (size)  Mode  Cnt     Score     Error  Units
AdditionBenchmark.addLoop       100  avgt   20    14.577 ±   1.583  ns/op
AdditionBenchmark.addLoop      1000  avgt   20   123.712 ±  17.867  ns/op
AdditionBenchmark.addLoop     10000  avgt   20  1419.690 ± 189.796  ns/op
AdditionBenchmark.addStream     100  avgt   20    63.078 ±   0.376  ns/op
AdditionBenchmark.addStream    1000  avgt   20   549.273 ±   7.554  ns/op
AdditionBenchmark.addStream   10000  avgt   20  5377.951 ±  33.166  ns/op

jmh-gradle-example's People

Contributors

martijndwars avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.