From 9f08e105e8863d68f6fe38a94a2c30cff2c2a76f Mon Sep 17 00:00:00 2001 From: kamahori Date: Thu, 30 Jul 2020 09:29:06 +0000 Subject: [PATCH 1/5] Change name of RNTuple H1 Benchmark --- root/tree/tree/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/tree/tree/CMakeLists.txt b/root/tree/tree/CMakeLists.txt index 2faa0023..dea5f030 100644 --- a/root/tree/tree/CMakeLists.txt +++ b/root/tree/tree/CMakeLists.txt @@ -16,7 +16,7 @@ if(ROOT_root7_FOUND AND rootbench-datafiles AND ROOT_dataframe_FOUND) DEPENDS libh1event ) - RB_ADD_GBENCHMARK(RNTupleAnalysisBenchmarks + RB_ADD_GBENCHMARK(RNTupleH1Benchmarks RNTupleH1Benchmarks.cxx LABEL short LIBRARIES Core Hist MathCore RIO Tree ROOTNTuple From 42af98b1c97c21e025adeefd794df2af394deb55 Mon Sep 17 00:00:00 2001 From: kamahori Date: Thu, 30 Jul 2020 09:31:49 +0000 Subject: [PATCH 2/5] Add RNTuple benchmark for ATLAS file --- root/tree/tree/CMakeLists.txt | 17 +++ root/tree/tree/RNTupleATLASBenchmarks.cxx | 149 +++++++++++++++++++ root/tree/tree/gen_atlas.cxx | 165 ++++++++++++++++++++++ 3 files changed, 331 insertions(+) create mode 100644 root/tree/tree/RNTupleATLASBenchmarks.cxx create mode 100644 root/tree/tree/gen_atlas.cxx diff --git a/root/tree/tree/CMakeLists.txt b/root/tree/tree/CMakeLists.txt index dea5f030..59c8a67f 100644 --- a/root/tree/tree/CMakeLists.txt +++ b/root/tree/tree/CMakeLists.txt @@ -16,6 +16,12 @@ if(ROOT_root7_FOUND AND rootbench-datafiles AND ROOT_dataframe_FOUND) DEPENDS libh1event ) + RB_ADD_TOOL(gen_atlas ${CMAKE_CURRENT_SOURCE_DIR}/gen_atlas.cxx + LIBRARIES Core Hist Imt RIO Tree TreePlayer + ROOTDataFrame ROOTVecOps ROOTNTuple + DEPENDS libh1event + ) + RB_ADD_GBENCHMARK(RNTupleH1Benchmarks RNTupleH1Benchmarks.cxx LABEL short @@ -30,6 +36,17 @@ if(ROOT_root7_FOUND AND rootbench-datafiles AND ROOT_dataframe_FOUND) SETUP "${RB_HADD_EXECUTABLE} -f404 ${RB_DATASETDIR}/h1dst-lz4.root ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "${RB_HADD_EXECUTABLE} -f506 ${RB_DATASETDIR}/h1dst-zstd.root ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "${RB_HADD_EXECUTABLE} -f0 ${RB_DATASETDIR}/h1dst-none.root ${RB_DATASETDIR}/h1dst-lzma.root") + + RB_ADD_GBENCHMARK(RNTupleATLASBenchmarks + RNTupleATLASBenchmarks.cxx + LABEL short + LIBRARIES Core Hist MathCore RIO Tree ROOTNTuple + DOWNLOAD_DATAFILES gg_data-zstd.root + SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c zlib" + SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c lzma" + SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c lz4" + SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c zstd" + SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c none") endif(ROOT_root7_FOUND AND rootbench-datafiles AND ROOT_dataframe_FOUND) if(ROOT_root7_FOUND AND rootbench-datafiles) diff --git a/root/tree/tree/RNTupleATLASBenchmarks.cxx b/root/tree/tree/RNTupleATLASBenchmarks.cxx new file mode 100644 index 00000000..1cf0d5c4 --- /dev/null +++ b/root/tree/tree/RNTupleATLASBenchmarks.cxx @@ -0,0 +1,149 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + + +static float ComputeInvariantMass(float pt0, float pt1, float eta0, float eta1, float phi0, float phi1, float e0, float e1) +{ + ROOT::Math::PtEtaPhiEVector p1(pt0, eta0, phi0, e0); + ROOT::Math::PtEtaPhiEVector p2(pt1, eta1, phi1, e1); + return (p1 + p2).mass() / 1000.0; +} + + +static void ProcessNTuple(ROOT::Experimental::RNTupleReader *ntuple, TH1D *hMass, bool isMC) +{ + + auto viewTrigP = ntuple->GetView("trigP"); + auto viewPhotonN = ntuple->GetView("photon_n"); + auto viewPhotonIsTightId = ntuple->GetView>("photon_isTightID"); + auto viewPhotonPt = ntuple->GetView>("photon_pt"); + auto viewPhotonEta = ntuple->GetView>("photon_eta"); + auto viewPhotonPhi = ntuple->GetView>("photon_phi"); + auto viewPhotonE = ntuple->GetView>("photon_E"); + auto viewPhotonPtCone30 = ntuple->GetView>("photon_ptcone30"); + auto viewPhotonEtCone20 = ntuple->GetView>("photon_etcone20"); + + auto viewScaleFactorPhoton = ntuple->GetView("scaleFactor_PHOTON"); + auto viewScaleFactorPhotonTrigger = ntuple->GetView("scaleFactor_PhotonTRIGGER"); + auto viewScaleFactorPileUp = ntuple->GetView("scaleFactor_PILEUP"); + auto viewMcWeight = ntuple->GetView("mcWeight"); + + unsigned nevents = 0; + for (auto e : ntuple->GetEntryRange()) { + nevents++; + + if (!viewTrigP(e)) continue; + + std::vector idxGood; + auto isTightId = viewPhotonIsTightId(e); + auto pt = viewPhotonPt(e); + auto eta = viewPhotonEta(e); + + for (size_t i = 0; i < viewPhotonN(e); ++i) { + if (!isTightId[i]) continue; + if (pt[i] <= 25000.) continue; + if (abs(eta[i]) >= 2.37) continue; + if (abs(eta[i]) >= 1.37 && abs(eta[i]) <= 1.52) continue; + idxGood.push_back(i); + } + if (idxGood.size() != 2) continue; + + auto ptCone30 = viewPhotonPtCone30(e); + auto etCone20 = viewPhotonEtCone20(e); + + bool isIsolatedPhotons = true; + for (int i = 0; i < 2; ++i) { + if ((ptCone30[idxGood[i]] / pt[idxGood[i]] >= 0.065) || + (etCone20[idxGood[i]] / pt[idxGood[i]] >= 0.065)) + { + isIsolatedPhotons = false; + break; + } + } + if (!isIsolatedPhotons) continue; + + auto phi = viewPhotonPhi(e); + auto E = viewPhotonE(e); + + float myy = ComputeInvariantMass( + pt[idxGood[0]], pt[idxGood[1]], + eta[idxGood[0]], eta[idxGood[1]], + phi[idxGood[0]], phi[idxGood[1]], + E[idxGood[0]], E[idxGood[1]]); + + if (pt[idxGood[0]] / 1000. / myy <= 0.35) continue; + if (pt[idxGood[1]] / 1000. / myy <= 0.25) continue; + if (myy <= 105) continue; + if (myy >= 160) continue; + + if (isMC) { + auto weight = viewScaleFactorPhoton(e) * viewScaleFactorPhotonTrigger(e) * + viewScaleFactorPileUp(e) * viewMcWeight(e); + hMass->Fill(myy, weight); + } else { + hMass->Fill(myy); + } + } +} + + +static void BM_RNTuple_ATLAS(benchmark::State &state, const std::string &comprAlgorithm) +{ + using RNTupleReader = ROOT::Experimental::RNTupleReader; + std::string path = RB::GetDataDir() + "/atlas-" + comprAlgorithm + ".ntuple"; + + for (auto _ : state) { + auto hData = new TH1D("", "Diphoton invariant mass; m_{#gamma#gamma} [GeV];Events", 30, 105, 160); + + auto ntuple = RNTupleReader::Open("mini", path); + ProcessNTuple(ntuple.get(), hData, false /* isMC */); + + delete hData; + } +} +BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_LZ4, "lz4")->Unit(benchmark::kMicrosecond)->Iterations(5); +BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_ZLIB, "zlib")->Unit(benchmark::kMicrosecond)->Iterations(5); +BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_LZMA, "lzma")->Unit(benchmark::kMicrosecond)->Iterations(5); +BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_ZSTD, "zstd")->Unit(benchmark::kMicrosecond)->Iterations(5); +BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_None, "none")->Unit(benchmark::kMicrosecond)->Iterations(5); + +BENCHMARK_MAIN(); \ No newline at end of file diff --git a/root/tree/tree/gen_atlas.cxx b/root/tree/tree/gen_atlas.cxx new file mode 100644 index 00000000..1f5ba5eb --- /dev/null +++ b/root/tree/tree/gen_atlas.cxx @@ -0,0 +1,165 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +using RNTupleModel = ROOT::Experimental::RNTupleModel; +using RFieldBase = ROOT::Experimental::Detail::RFieldBase; +using RNTupleWriter = ROOT::Experimental::RNTupleWriter; +using RNTupleWriteOptions = ROOT::Experimental::RNTupleWriteOptions; + +int GetCompressionSettings(std::string shorthand) +{ + if (shorthand == "zlib") + return 101; + if (shorthand == "lz4") + return 404; + if (shorthand == "lzma") + return 207; + if (shorthand == "zstd") + return 505; + if (shorthand == "none") + return 0; + abort(); +} + + +static void SplitPath(const std::string &path, std::string *basename, std::string *suffix) +{ + size_t idx_dot = path.find_last_of("."); + if (idx_dot == std::string::npos) { + *basename = path; + suffix->clear(); + } else { + *basename = path.substr(0, idx_dot); + *suffix = path.substr(idx_dot + 1); + } +} + + +std::string StripSuffix(const std::string &path) { + std::string basename; + std::string suffix; + SplitPath(path, &basename, &suffix); + return basename; +} + + +std::string GetFileName(const std::string &path) { + const std::string::size_type idx = path.find_last_of('/'); + if (idx != std::string::npos) + return path.substr(idx+1); + else + return path; +} + + +void Usage(char *progname) { + std::cout << "Usage: " << progname << " -i -o -c " << std::endl; +} + + +int main(int argc, char **argv) { + std::string inputFile = "gg_data.root"; + std::string outputPath = "."; + int compressionSettings = 0; + std::string compressionShorthand = "none"; + + int c; + while ((c = getopt(argc, argv, "hvi:o:c:")) != -1) { + switch (c) { + case 'h': + case 'v': + Usage(argv[0]); + return 0; + case 'i': + inputFile = optarg; + break; + case 'o': + outputPath = optarg; + break; + case 'c': + compressionSettings = GetCompressionSettings(optarg); + compressionShorthand = optarg; + break; + default: + fprintf(stderr, "Unknown option: -%c\n", c); + Usage(argv[0]); + return 1; + } + } + std::string outputFile = outputPath + "/" + "atlas" + "-" + compressionShorthand + ".ntuple"; + + std::unique_ptr f(TFile::Open(inputFile.c_str())); + assert(f && ! f->IsZombie()); + + auto model = RNTupleModel::Create(); + + auto tree = f->Get("mini"); + for (auto b : TRangeDynCast(*tree->GetListOfBranches())) { + assert(b); + + TLeaf *l = static_cast(b->GetListOfLeaves()->First()); + + auto field = RFieldBase::Create(l->GetName(), l->GetTypeName()); + + if (typeid(*b) == typeid(TBranchSTL) || typeid(*b) == typeid(TBranchElement)) { + if (field->GetType() == "std::vector") { + std::vector **v = new std::vector *(); + tree->SetBranchAddress(b->GetName(), v); + model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); + model->GetRootField()->Attach(std::unique_ptr(field)); + } else if (field->GetType() == "std::vector") { + std::vector **v = new std::vector *(); + tree->SetBranchAddress(b->GetName(), v); + model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); + model->GetRootField()->Attach(std::unique_ptr(field)); + } else if (field->GetType() == "std::vector") { + std::vector **v = new std::vector *(); + tree->SetBranchAddress(b->GetName(), v); + model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); + model->GetRootField()->Attach(std::unique_ptr(field)); + } else if (field->GetType() == "std::vector") { + std::vector **v = new std::vector *(); + tree->SetBranchAddress(b->GetName(), v); + model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); + model->GetRootField()->Attach(std::unique_ptr(field)); + } else { + assert(false); + } + } else { + model->AddField(std::unique_ptr(field)); + void *fieldDataPtr = model->GetDefaultEntry()->GetValue(l->GetName()).GetRawPtr(); + tree->SetBranchAddress(b->GetName(), fieldDataPtr); + } + } + + RNTupleWriteOptions options; + options.SetCompression(compressionSettings); + auto ntuple = RNTupleWriter::Recreate(std::move(model), "mini", outputFile, options); + + auto nEntries = tree->GetEntries(); + for (decltype(nEntries) i = 0; i < nEntries; ++i) { + tree->GetEntry(i); + ntuple->Fill(); + } + + tree->ResetBranchAddresses(); +} \ No newline at end of file From 6ffd1c67bf381151e4da3f7bd8aabf335ec24631 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Thu, 3 Sep 2026 20:11:33 +0000 Subject: [PATCH 3/5] Rewrite gen_atlas on top of RNTupleImporter The original implementation built the RNTuple model by hand from the TTree branches, using low-level RField interfaces that no longer exist in current ROOT. ROOT has since gained RNTupleImporter, which does this conversion generically, so use it instead. Like gen_h1, the tool is now also a no-op if the output file already exists. --- root/tree/tree/gen_atlas.cxx | 124 +++++------------------------------ 1 file changed, 17 insertions(+), 107 deletions(-) diff --git a/root/tree/tree/gen_atlas.cxx b/root/tree/tree/gen_atlas.cxx index 1f5ba5eb..e200bc89 100644 --- a/root/tree/tree/gen_atlas.cxx +++ b/root/tree/tree/gen_atlas.cxx @@ -1,29 +1,14 @@ -#include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include #include -#include #include -#include #include -using RNTupleModel = ROOT::Experimental::RNTupleModel; -using RFieldBase = ROOT::Experimental::Detail::RFieldBase; -using RNTupleWriter = ROOT::Experimental::RNTupleWriter; -using RNTupleWriteOptions = ROOT::Experimental::RNTupleWriteOptions; +using ROOT::Experimental::RNTupleImporter; int GetCompressionSettings(std::string shorthand) { @@ -40,43 +25,13 @@ int GetCompressionSettings(std::string shorthand) abort(); } - -static void SplitPath(const std::string &path, std::string *basename, std::string *suffix) +void Usage(char *progname) { - size_t idx_dot = path.find_last_of("."); - if (idx_dot == std::string::npos) { - *basename = path; - suffix->clear(); - } else { - *basename = path.substr(0, idx_dot); - *suffix = path.substr(idx_dot + 1); - } -} - - -std::string StripSuffix(const std::string &path) { - std::string basename; - std::string suffix; - SplitPath(path, &basename, &suffix); - return basename; -} - - -std::string GetFileName(const std::string &path) { - const std::string::size_type idx = path.find_last_of('/'); - if (idx != std::string::npos) - return path.substr(idx+1); - else - return path; -} - - -void Usage(char *progname) { std::cout << "Usage: " << progname << " -i -o -c " << std::endl; } - -int main(int argc, char **argv) { +int main(int argc, char **argv) +{ std::string inputFile = "gg_data.root"; std::string outputPath = "."; int compressionSettings = 0; @@ -105,61 +60,16 @@ int main(int argc, char **argv) { return 1; } } - std::string outputFile = outputPath + "/" + "atlas" + "-" + compressionShorthand + ".ntuple"; - - std::unique_ptr f(TFile::Open(inputFile.c_str())); - assert(f && ! f->IsZombie()); - - auto model = RNTupleModel::Create(); - - auto tree = f->Get("mini"); - for (auto b : TRangeDynCast(*tree->GetListOfBranches())) { - assert(b); - - TLeaf *l = static_cast(b->GetListOfLeaves()->First()); - - auto field = RFieldBase::Create(l->GetName(), l->GetTypeName()); - - if (typeid(*b) == typeid(TBranchSTL) || typeid(*b) == typeid(TBranchElement)) { - if (field->GetType() == "std::vector") { - std::vector **v = new std::vector *(); - tree->SetBranchAddress(b->GetName(), v); - model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); - model->GetRootField()->Attach(std::unique_ptr(field)); - } else if (field->GetType() == "std::vector") { - std::vector **v = new std::vector *(); - tree->SetBranchAddress(b->GetName(), v); - model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); - model->GetRootField()->Attach(std::unique_ptr(field)); - } else if (field->GetType() == "std::vector") { - std::vector **v = new std::vector *(); - tree->SetBranchAddress(b->GetName(), v); - model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); - model->GetRootField()->Attach(std::unique_ptr(field)); - } else if (field->GetType() == "std::vector") { - std::vector **v = new std::vector *(); - tree->SetBranchAddress(b->GetName(), v); - model->GetDefaultEntry()->CaptureValue(field->CaptureValue(*v)); - model->GetRootField()->Attach(std::unique_ptr(field)); - } else { - assert(false); - } - } else { - model->AddField(std::unique_ptr(field)); - void *fieldDataPtr = model->GetDefaultEntry()->GetValue(l->GetName()).GetRawPtr(); - tree->SetBranchAddress(b->GetName(), fieldDataPtr); - } + std::string outputFile = outputPath + "/atlas-" + compressionShorthand + ".ntuple"; + if (!gSystem->AccessPathName(outputFile.c_str())) { + std::cout << "Output file " << outputFile << " already exists, nothing to do" << std::endl; + return 0; } + std::cout << "Converting " << inputFile << " --> " << outputFile << std::endl; - RNTupleWriteOptions options; + auto importer = RNTupleImporter::Create(inputFile, "mini", outputFile); + ROOT::RNTupleWriteOptions options; options.SetCompression(compressionSettings); - auto ntuple = RNTupleWriter::Recreate(std::move(model), "mini", outputFile, options); - - auto nEntries = tree->GetEntries(); - for (decltype(nEntries) i = 0; i < nEntries; ++i) { - tree->GetEntry(i); - ntuple->Fill(); - } - - tree->ResetBranchAddresses(); -} \ No newline at end of file + importer->SetWriteOptions(options); + importer->Import(); +} From 468fc2dd47bcef8a1ba7d916acea69a0200b58ac Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Thu, 3 Sep 2026 20:11:45 +0000 Subject: [PATCH 4/5] Adapt RNTupleATLASBenchmarks to current ROOT The RNTuple classes moved out of the ROOT::Experimental namespace. Also remove the many unused includes and link gen_atlas against the libraries it actually needs. --- root/tree/tree/CMakeLists.txt | 4 +-- root/tree/tree/RNTupleATLASBenchmarks.cxx | 39 +++-------------------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/root/tree/tree/CMakeLists.txt b/root/tree/tree/CMakeLists.txt index 59c8a67f..da36414f 100644 --- a/root/tree/tree/CMakeLists.txt +++ b/root/tree/tree/CMakeLists.txt @@ -17,9 +17,7 @@ if(ROOT_root7_FOUND AND rootbench-datafiles AND ROOT_dataframe_FOUND) ) RB_ADD_TOOL(gen_atlas ${CMAKE_CURRENT_SOURCE_DIR}/gen_atlas.cxx - LIBRARIES Core Hist Imt RIO Tree TreePlayer - ROOTDataFrame ROOTVecOps ROOTNTuple - DEPENDS libh1event + LIBRARIES Core RIO Tree ROOTNTuple ROOTNTupleUtil ) RB_ADD_GBENCHMARK(RNTupleH1Benchmarks diff --git a/root/tree/tree/RNTupleATLASBenchmarks.cxx b/root/tree/tree/RNTupleATLASBenchmarks.cxx index 1cf0d5c4..b4e38a90 100644 --- a/root/tree/tree/RNTupleATLASBenchmarks.cxx +++ b/root/tree/tree/RNTupleATLASBenchmarks.cxx @@ -1,40 +1,11 @@ #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include @@ -49,7 +20,7 @@ static float ComputeInvariantMass(float pt0, float pt1, float eta0, float eta1, } -static void ProcessNTuple(ROOT::Experimental::RNTupleReader *ntuple, TH1D *hMass, bool isMC) +static void ProcessNTuple(ROOT::RNTupleReader *ntuple, TH1D *hMass, bool isMC) { auto viewTrigP = ntuple->GetView("trigP"); @@ -128,7 +99,7 @@ static void ProcessNTuple(ROOT::Experimental::RNTupleReader *ntuple, TH1D *hMass static void BM_RNTuple_ATLAS(benchmark::State &state, const std::string &comprAlgorithm) { - using RNTupleReader = ROOT::Experimental::RNTupleReader; + using ROOT::RNTupleReader; std::string path = RB::GetDataDir() + "/atlas-" + comprAlgorithm + ".ntuple"; for (auto _ : state) { @@ -146,4 +117,4 @@ BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_LZMA, "lzma")->Unit(benchma BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_ZSTD, "zstd")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_None, "none")->Unit(benchmark::kMicrosecond)->Iterations(5); -BENCHMARK_MAIN(); \ No newline at end of file +BENCHMARK_MAIN(); From 56c6cfe8a08e388de5715c7e728f24323a9eafde Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Thu, 3 Sep 2026 20:12:10 +0000 Subject: [PATCH 5/5] Only use three compression configurations in ATLAS RNTuple benchmark The input file is about 1.9 GB, so converting it once per compression algorithm dominates the setup time of the benchmark. Keep zstd (the RNTuple default), lzma (the strongest) and uncompressed as the extremes, and drop zlib and lz4. --- root/tree/tree/CMakeLists.txt | 2 -- root/tree/tree/RNTupleATLASBenchmarks.cxx | 2 -- 2 files changed, 4 deletions(-) diff --git a/root/tree/tree/CMakeLists.txt b/root/tree/tree/CMakeLists.txt index da36414f..1fe92041 100644 --- a/root/tree/tree/CMakeLists.txt +++ b/root/tree/tree/CMakeLists.txt @@ -40,9 +40,7 @@ if(ROOT_root7_FOUND AND rootbench-datafiles AND ROOT_dataframe_FOUND) LABEL short LIBRARIES Core Hist MathCore RIO Tree ROOTNTuple DOWNLOAD_DATAFILES gg_data-zstd.root - SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c zlib" SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c lzma" - SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c lz4" SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c zstd" SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_atlas -i ${RB_DATASETDIR}/gg_data-zstd.root -o ${RB_DATASETDIR} -c none") endif(ROOT_root7_FOUND AND rootbench-datafiles AND ROOT_dataframe_FOUND) diff --git a/root/tree/tree/RNTupleATLASBenchmarks.cxx b/root/tree/tree/RNTupleATLASBenchmarks.cxx index b4e38a90..9964a916 100644 --- a/root/tree/tree/RNTupleATLASBenchmarks.cxx +++ b/root/tree/tree/RNTupleATLASBenchmarks.cxx @@ -111,8 +111,6 @@ static void BM_RNTuple_ATLAS(benchmark::State &state, const std::string &comprAl delete hData; } } -BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_LZ4, "lz4")->Unit(benchmark::kMicrosecond)->Iterations(5); -BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_ZLIB, "zlib")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_LZMA, "lzma")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_ZSTD, "zstd")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_RNTuple_ATLAS, BM_RNTuple_ATLAS_None, "none")->Unit(benchmark::kMicrosecond)->Iterations(5);