Skip to content

Commit

Permalink
[RF] Merge all benchmarks that are comparing the new BatchMode backends
Browse files Browse the repository at this point in the history
Also, add a Python script to create a plot with benchmark results.
  • Loading branch information
guitargeek committed Apr 24, 2023
1 parent 8d5b320 commit c3be502
Show file tree
Hide file tree
Showing 11 changed files with 582 additions and 676 deletions.
11 changes: 9 additions & 2 deletions root/roofit/roofit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
RB_ADD_GBENCHMARK(RoofitBinnedBenchmark
RB_ADD_GBENCHMARK(benchRooFitBinned
RooFitBinnedBenchmarks.cxx
LABEL long
LIBRARIES Core Hist MathCore RIO RooFit RooStats RooFitCore HistFactory)

RB_ADD_GBENCHMARK(RoofitUnBinnedBenchmark
RB_ADD_GBENCHMARK(benchRooFitUnbinned
RooFitUnBinnedBenchmarks.cxx
LABEL long
LIBRARIES Core Hist MathCore RIO RooFit RooStats RooFitCore HistFactory)

RB_ADD_GBENCHMARK(benchRooFitBackends
benchRooFitBackends.cxx
LABEL long
LIBRARIES Core MathCore RooFitCore RooFit)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/benchRooFitBackends_make_plot.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
16 changes: 14 additions & 2 deletions root/roofit/roofit/RooFitUnBinnedBenchmarks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,25 @@ std::string convertBatchModeToString(int batchMode)
return "off";
}

std::unique_ptr<RooHelpers::LocalChangeMsgLevel> makeChangeMsgLvl()
{
auto &msg = RooMsgService::instance();
msg.reset();
auto oldKillBelow = msg.globalKillBelow();
auto out = std::make_unique<RooHelpers::LocalChangeMsgLevel>(RooFit::WARNING);
msg.setGlobalKillBelow(oldKillBelow);
// Keep the FastEvaluations info so we see which classes still need to be supported
msg.addStream(RooFit::INFO, Topic(RooFit::FastEvaluations));
return out;
}

} // namespace

static void BM_RooFit_BDecayWithMixing(benchmark::State &state)
{
using namespace RooFit;

RooHelpers::LocalChangeMsgLevel changeMsgLvl(RooFit::WARNING);
auto changeMsgLevel = makeChangeMsgLvl();

gErrorIgnoreLevel = kInfo;
int events = state.range(0);
Expand Down Expand Up @@ -103,7 +115,7 @@ static void BM_RooFit_BDecayGaussResolution(benchmark::State &state)
{
using namespace RooFit;

RooHelpers::LocalChangeMsgLevel changeMsgLvl(RooFit::WARNING);
auto changeMsgLevel = makeChangeMsgLvl();

gErrorIgnoreLevel = kInfo;
int events = state.range(0);
Expand Down
Loading

0 comments on commit c3be502

Please sign in to comment.