public class StubInvocationBenchmark extends Object
This benchmark measures the invocation speed of stub method invocations. All classes implement
ExampleInterface and implement all methods to return the return type's
default value, independently of the arguments.
Note that this class defines all values that are accessed by benchmark methods as instance fields. This way, the JIT compiler's capability of constant folding is limited in order to produce more comparable test results.
| Constructor and Description |
|---|
StubInvocationBenchmark() |
| Modifier and Type | Method and Description |
|---|---|
void |
baseline(Blackhole blackHole)
Performs a benchmark for a casual class as a baseline.
|
void |
benchmarkByteBuddy(Blackhole blackHole)
Performs a benchmark for a trivial class creation using Byte Buddy.
|
void |
benchmarkCglib(Blackhole blackHole)
Performs a benchmark for a trivial class creation using cglib.
|
void |
benchmarkJavassist(Blackhole blackHole)
Performs a benchmark for a trivial class creation using javassist.
|
void |
benchmarkJdkProxy(Blackhole blackHole)
Performs a benchmark for a trivial class creation using the Java Class Library's utilities.
|
void |
setUp()
Creates an instance for each code generation library.
|
public void setUp()
throws Exception
ClassByImplementationBenchmark.Exception - Covers the exception declarations of the setup methods.public void baseline(Blackhole blackHole)
blackHole - A black hole for avoiding JIT erasure.public void benchmarkByteBuddy(Blackhole blackHole)
blackHole - A black hole for avoiding JIT erasure.public void benchmarkCglib(Blackhole blackHole)
blackHole - A black hole for avoiding JIT erasure.public void benchmarkJavassist(Blackhole blackHole)
blackHole - A black hole for avoiding JIT erasure.public void benchmarkJdkProxy(Blackhole blackHole)
blackHole - A black hole for avoiding JIT erasure.Copyright © 2014–2023. All rights reserved.