Skip to content

Commit f5588e0

Browse files
committed
RNTuple LHCB bench: parameterize fraction of events read
And measure runtimes for 25%, 50% and 100% of the events.
1 parent 34c9b04 commit f5588e0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

root/tree/tree/RNTupleLHCBBenchmarks.cxx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ static void BM_RNTuple_LHCB(benchmark::State &state)
4949

5050
auto hMass = new TH1D("B_mass", "", 500, 5050, 5500);
5151

52+
const Long64_t nEntries = ntuple->GetNEntries() * (state.range(0) / 100.);
53+
5254
for (auto _ : state) {
5355
hMass->Reset();
54-
for (auto i : ntuple->GetEntryRange()) {
56+
for (auto i = 0ll; i < nEntries; ++i) {
57+
ntuple->LoadEntry(i);
58+
5559
if (viewH1IsMuon(i) || viewH2IsMuon(i) || viewH3IsMuon(i)) {
5660
continue;
5761
}
@@ -84,11 +88,15 @@ static void BM_RNTuple_LHCB(benchmark::State &state)
8488
hMass->Fill(b_mass);
8589
}
8690
}
87-
RB::Ensure(int(hMass->GetMean()) == 5262);
88-
RB::Ensure(int(hMass->GetEntries()) == 23895);
91+
if (state.range(0) == 100) {
92+
// sanity checks
93+
RB::Ensure(int(hMass->GetMean()) == 5262);
94+
RB::Ensure(int(hMass->GetEntries()) == 23895);
95+
}
8996
delete hMass;
9097
}
91-
BENCHMARK(BM_RNTuple_LHCB)->Unit(benchmark::kMicrosecond)->Iterations(3);
98+
// Arg is the % of events to be processed
99+
BENCHMARK(BM_RNTuple_LHCB)->Unit(benchmark::kMicrosecond)->Iterations(5)->Arg(100)->Arg(50)->Arg(25);
92100

93101
BENCHMARK_MAIN();
94102

0 commit comments

Comments
 (0)