Skip to content

Commit

Permalink
Add benchmark for map get operation
Browse files Browse the repository at this point in the history
  • Loading branch information
msteindorfer committed Oct 2, 2023
1 parent 1c338f1 commit 4e25ed7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ public void timeContainsKey(Blackhole bh) {
}
}

@Benchmark
@OperationsPerInvocation(CACHED_NUMBERS_SIZE)
public void timeGet(Blackhole bh) {
for (int i = 0; i < CACHED_NUMBERS_SIZE; i++) {
bh.consume(testMap.get(cachedNumbers[i]));
}
}

// @Benchmark
// @OperationsPerInvocation(CACHED_NUMBERS_SIZE)
// public void timeContainsKeyInt(Blackhole bh) {
Expand Down

0 comments on commit 4e25ed7

Please sign in to comment.