Package org.openjdk.jmh.samples
Class JMHSample_25_API_GA
- java.lang.Object
-
- org.openjdk.jmh.samples.JMHSample_25_API_GA
-
- Direct Known Subclasses:
JMHSample_25_API_GA_jmhType_B1
public class JMHSample_25_API_GA extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JMHSample_25_API_GA.Chromosome
Chromosome: encodes solution.static class
JMHSample_25_API_GA.Population
Population.
-
Field Summary
Fields Modifier and Type Field Description private int
v
This example shows the rather convoluted, but fun way to exploit JMH API in complex scenarios.
-
Constructor Summary
Constructors Constructor Description JMHSample_25_API_GA()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
int
test()
int
veryImportantCode(int d, int v)
-
-
-
Field Detail
-
v
private int v
This example shows the rather convoluted, but fun way to exploit JMH API in complex scenarios. Up to this point, we haven't consumed the results programmatically, and hence we are missing all the fun. Let's consider this naive code, which obviously suffers from the performance anomalies, since current HotSpot is resistant to make the tail-call optimizations.
-
-
Method Detail
-
test
public int test()
-
veryImportantCode
public int veryImportantCode(int d, int v)
-
main
public static void main(java.lang.String[] args) throws RunnerException
- Throws:
RunnerException
-
-