my-spring-boot-experiments
  • README
  • Spring Batch implementation
  • API Example for Archunit
  • spring-boot-chaos-monkey
  • Grafana LGTM Implementation
  • MongoDb for insertion and search using elastic search
  • OpenSearch Implementation
  • spring-boot-rabbitmq-thymeleaf
  • boot-rest-docs-sample
  • boot-strategy-plugin
  • spring-boot-togglz-sample
  • spring-boot-ultimate-redis
  • GraphQL
    • spring-boot-graphql-querydsl
    • GraphQl implementation using webflux
    • GraphQl implementation using webmvc
  • httpClients
    • http-proxy
    • rest-template
    • rest-client
    • web-client-mvc
    • web-client-webflux
  • jmh-benchmark
  • jpa
    • Custom Sequence
    • Hibernate Envers Implementation
    • multiple datasources using Spring Boot
    • spring-boot-hibernate2ndlevelcache-sample
    • JNDI in embedded Tomcat
    • JPA Jooq Marriage
    • JPA locks implementation
    • read-replica-with-spring-boot
    • KeySet Pagination Using Blaze
    • KeySet Pagination Using Data-JPA
    • MultiTenancy using Hibernate in Spring Data JPA
      • multitenancy-db
      • multidatasource-multitenancy
      • Partitioned (Discriminator) Data – the data for each tenant is partitioned by a discriminator value
      • schema
  • open-api-spring-boot
  • r2dbc
    • r2dbc-jooq
    • PostgreSQL JSON and enum column support
    • PostgreSQL Notify and Listen support using reactive spring boot
    • r2dbc-boot
    • reactive-cache
  • scheduler
    • Scheduling using JobRunr
    • Scheduling using Quartz
    • Scheduling using Shedlock distribution
  • Code Of Conduct
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub

jmh-benchmark

JMH (Java Microbenchmark Harness) is a Java framework that allows you to write, run, and measure the performance of microbenchmarks. A microbenchmark is a small piece of code that measures the performance of a specific operation or piece of functionality.

JMH is designed to provide reliable benchmarking results by taking into account a number of factors that can affect the accuracy of benchmarks, such as JVM warmup time, garbage collection, and CPU throttling. It also provides a number of tools for analyzing benchmark results, such as statistical analysis and charting.

To write a JMH benchmark, you typically create a class that extends the org.openjdk.jmh.annotations.Benchmark annotation and contains a method that performs the operation you want to measure. You can use other annotations to configure the benchmark, such as @Setup to set up any necessary state before the benchmark runs, and @Param to specify different parameters to test.

Once you have written your benchmark, you can run it using the JMH command-line tool, which will execute the benchmark multiple times and produce a report of the results. The report will include information such as the average execution time, the standard deviation, and the confidence interval for each benchmark.

JMH is a powerful tool for measuring the performance of Java code, but it is important to use it carefully and to interpret the results with caution. Microbenchmarks can be highly sensitive to changes in the environment and to variations in the input data, so it is important to understand the limitations of the benchmarks and to use them as just one tool in a broader performance analysis.

Previousweb-client-webfluxNextjpa

Last updated 1 year ago

Was this helpful?