What is the number of operations in JMH?

JavaDoc annotations @OperationsPerInvocationin Java Microbenchmarking Harness (JMH) states:

value public abstract int value

Returns:The number of operations per Benchmark call. Default: 1

Being new to JMH, I wonder what type of operation (bytecode operation, assembly code operation, Java operation, etc.) is implied here.

This question naturally applies to all places in the JMH (documentation, output, comments, etc.) Where the term “operation” is used (for example, “operation / time” or “unit of time / operation”).

+6
source share
1 answer

JMH "" . . :

Benchmark               Mode  Cnt  Score   Error  Units
MyBenchmark.testMethod  avgt    5  5.068 ± 0.586  ns/op

5.068 .

- @Benchmark. , @OperationsPerInvocation, , @Benchmark N . , , . @Measurement(batchSize = N) , N @Benchmark invocations.

+9

Source: https://habr.com/ru/post/1606987/


All Articles