Skip to content

Commit 2eff3b8

Browse files
andreas-abelcopybara-github
authored andcommitted
Add a warmup phase to the cold swissmap benchmarks
PiperOrigin-RevId: 725278544 Change-Id: Ie2ea44c8e1ddf371879627d02884ec6f1a43c4dc
1 parent e77fa15 commit 2eff3b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fleetbench/swissmap/cold_swissmap_benchmark.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ void LookupHit_Cold(benchmark::State& state, Lookup lookup) {
9393
auto& keys = sc.GetTransposedRandomizedKeys(sets);
9494
auto& n_sets_of_size = sc.GetNumSetsOfSize(sets);
9595

96+
int64_t warmup = 500;
9697
while (true) {
9798
for (size_t i = 0; i != GetLargestSetSize(sets); ++i) {
98-
if (!state.KeepRunningBatch(n_sets_of_size[i + 1])) return;
99+
if ((warmup-- <= 0) && !state.KeepRunningBatch(n_sets_of_size[i + 1]))
100+
return;
99101
for (size_t j = 0; j < n_sets_of_size[i + 1]; ++j) {
100102
lookup(&sets[j], keys[i * sets.size() + j]);
101103
}

0 commit comments

Comments
 (0)