Professional Documents
Culture Documents
https://gitlab.com/ubb-mle5109/2022/lab-samples/-/blob/main/lab2/pom.xml
JMH tests using Maven
mvn archetype:generate \
-DinteractiveMode=false \
-DarchetypeGroupId=org.openjdk.jmh \
-DarchetypeArtifactId=jmh-java-benchmark-archetype \
-DgroupId=org.sample \
-DartifactId=test \
-Dversion=1.0
Supported profilers:
cl: Classloader profiling via standard MBeans
comp: JIT compiler profiling via standard
MBeans
gc: GC profiling via standard MBeans
jfr: Java Flight Recorder profiler
pauses: Pauses profiler
perfc2c: Linux perf c2c profiler
safepoints: Safepoints profiler
stack: Simple and naive Java stack profiler
JMH - useful links
• JMH tutorial
• OpenJDK-JMH
• Java Performance - JMH
• Samples
• Command Line Options
• JMH archetype
Favor composition over inheritance
○ From JDK
■ Stack is not a Vector
■ Properties is not a Hashtable
Favor composition over inheritance
● Instrumented set
# JMH version: 1.35
# VM version: JDK 11.0.8, OpenJDK 64-Bit Server VM, 11.0.8+10
# Warmup: 5 iterations, 10 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
<version>11.1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.collections</
groupId>
<artifactId>eclipse-collections-testutils</
artifactId>
<version>11.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.collections</
groupId>
<artifactId>eclipse-collections-forkjoin</
artifactId>
<version>11.1.0</version>
</dependency>
12
Libs - Koloboke - pocket guide
• Guide: Reference guide
• Source code: GitHub
• Maven dependencies:
13
Libs - trove4j - pocket guide
• Guide: Reference guide
• Source code: Bitbucket
• Maven dependencies:
14
Libs - Fastutil - pocket guide
• Guide: Reference guide
• Source code: GitHub
• Maven dependencies:
15