activemq-artemis/tests/performance-jmh
Justin Bertram d9d84f814c ARTEMIS-5048 use java.util.Base64
We've traditionally used org.apache.activemq.artemis.utils.Base64 for
Base64 encoding/decoding. This implementation is based on public domain
code from http://iharder.net/base64.

In Java 8 java.util.Base64 was introduced. I assumed we hadn't switched
to this implementation for performance reasons so I created a simple
JMH-based test to compare the two implementations and it appears to me
that java.util.Base64 is significantly faster than our current
implementation. Using the JDK's class will simplify our code and
improve performance. Also, it should be 100% backwards compatible
since Base64 encoding/decoding is standardized.
2024-09-18 12:15:14 -07:00
..
src/main/java/org/apache/activemq/artemis/tests/performance/jmh ARTEMIS-5048 use java.util.Base64 2024-09-18 12:15:14 -07:00
README.md ARTEMIS-2996 Provide JMH Benchmarks for Artemis 2020-11-17 14:39:17 -05:00
pom.xml ARTEMIS-5048 add test to demonstrate performance difference 2024-09-18 12:15:14 -07:00

README.md

Apache Artemix JMH Benchmarks

This module contains optional JMH performance tests.

Note that this module is an optional part of the overall project build and does not deploy anything, due to its use of JMH which is not permissively licensed. The module must be built directly.

Building the benchmarks

The benchmarks are maven built and involve some code generation for the JMH part. As such it is required that you rebuild upon changing the code.

mvn clean install

Running the benchmarks: General

It is recommended that you consider some basic benchmarking practices before running benchmarks:

  1. Use a quiet machine with enough CPUs to run the number of threads you mean to run.
  2. Set the CPU freq to avoid variance due to turbo boost/heating.
  3. Use an OS tool such as taskset to pin the threads in the topology you mean to measure.

Running the JMH Benchmarks

To run all JMH benchmarks:

java -jar target/benchmark.jar

To list available benchmarks:

java -jar target/benchmark.jar -l

Some JMH help:

java -jar target/benchmark.jar -h

Example

To run a benchmark on a single thread (tg 1) with gc profiling use:

java -jar target/benchmark.jar -prof gc -tg 1