Package org.openjdk.jmh.annotations
Annotation Type OperationsPerInvocation
-
@Inherited @Target({METHOD,TYPE}) @Retention(RUNTIME) public @interface OperationsPerInvocation
OperationsPerInvocation annotations allows to communicate the benchmark does more than one operation, and let JMH to adjust the scores appropriately.
For example, a benchmark which uses the internal loop to have multiple operations, may want to measure the performance of a single operation:
@Benchmark @OperationsPerInvocation(10) public void test() { for (int i = 0; i < 10; i++) { // do something } }This annotation may be put at
Benchmarkmethod to have effect on that method only, or at the enclosing class instance to have the effect over allBenchmarkmethods in the class.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intvalue
-
-
-
Element Detail
-
value
int value
- Returns:
- Number of operations per single
Benchmarkcall.
- Default:
- 1
-
-