Withdrawn: Allow setting of opsPerInvocation from setup functions

duke duke at openjdk.org
Tue Jan 2 06:54:08 UTC 2024


On Fri, 17 Mar 2023 12:54:38 GMT, bbrehm <duke at openjdk.org> wrote:

> In many cases, opsPerInvocation is known at the @Setup function, but cannot be reasonably known at any other point. This example is somewhat lame in that regard; I actually needed that for some not-quite-micro benchmarks (the setup function loads real-ish data from disk, and the opsPerInvocation depends on the data that has been loaded).
> 
> Since every good example teaches multiple things, I added one that also warns about the branch history table stitching together surprisingly long patterns.
> 
> The super-duper correct way of doing this example (cf https://discourse.julialang.org/t/psa-microbenchmarks-remember-branch-history/17436) would be to have constant opsPerInvocation and one large array; then a smaller (@Param) array is copied into that multiple times. Thus we could exclude effects of memory hierarchy. That would look quite unnatural and harder to relate to "normal looking" code (and there are no effects of memory anyway, since first, the benchmark is too slow to saturate DRAM bandwidth, and second even the largest set fits into L2).

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jmh/pull/97


More information about the jmh-dev mailing list