Unusual behavior of java.util.Optional in benchmark mode
Aleksey Shipilev
shade at redhat.com
Thu Sep 12 18:39:25 UTC 2019
On 9/12/19 8:32 PM, John Auden wrote:
> I tried to do assembly code analysis, and I see where Optional is
> being created (https://github.com/alex-dubrouski/java-test/blob/master/docs/conditionals/Optional.txt),
> but still can't explain why there are 133 millions of them.
>
> Would be very thankful if you can take a look and help me explain this.
You apparently think that "iteration" is one call to @Benchmark. It is not, there are multiple
invocations of @Benchmark in AverageTime/Throughput modes, which would call @Benchmark continuously,
until time allows.
--
Thanks,
-Aleksey
More information about the jmh-dev
mailing list