Add benchmark to measure performance of VH adapters #175
This patch adds a straightforward benchmark to measure performances of var handle adapters.
The benchmark is set up to read values from an int array, both with a var handle(obtained from
Then the same test is repeated, but with an extra adaptation step inserted in the middle - rather than reading
Numbers are extremeluy solid on my machine:
I thought it would have been nice to add this to our benchmark suites since we do not have anything that tests VH adaptation directly.
With the adapter creating IntBox, this benchmark is also testing whether C2 can eliminate the allocation of the box.
If the goal is to measure an adapted VarHandle against a non-adapted baseline VarHandle, I think it makes sense to have the adapters be the identity function, since then the only difference is whether an adapter is present or not.
@mcimadamore This change now passes all automated pre-integration checks, type
Since the source branch of this PR was last updated there has been 1 commit pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge