From 321e1044257eae8ef2d5357e022007199156f46c Mon Sep 17 00:00:00 2001 From: Oksana Shadura Date: Fri, 19 Mar 2021 15:54:30 +0100 Subject: [PATCH 1/4] Enable testing of FLZMA2 in ROOT --- root/io/io/TFile_ATLAS_Benchmarks.cxx | 3 ++- .../TFile_CompressionBenchmarks_MainEvent.cxx | 19 +++++++++++++++++-- root/io/io/TFile_LHCb_Benchmarks.cxx | 16 +++++++++++++++- root/io/io/TFile_NanoAOD_Benchmarks.cxx | 17 ++++++++++++++++- root/io/io/TFile_RDFSnapshot.cxx | 10 ++++++++++ 5 files changed, 60 insertions(+), 5 deletions(-) diff --git a/root/io/io/TFile_ATLAS_Benchmarks.cxx b/root/io/io/TFile_ATLAS_Benchmarks.cxx index d7c94d93..7ef06cb9 100644 --- a/root/io/io/TFile_ATLAS_Benchmarks.cxx +++ b/root/io/io/TFile_ATLAS_Benchmarks.cxx @@ -11,7 +11,8 @@ static std::string GetAlgoName(int algo) { {1, "zlib"}, {2, "lzma"}, {4, "lz4"}, - {5, "zstd"} + {5, "zstd"}, + {6, "flzma2"} }; if (algoName.find(algo) != algoName.end()) diff --git a/root/io/io/TFile_CompressionBenchmarks_MainEvent.cxx b/root/io/io/TFile_CompressionBenchmarks_MainEvent.cxx index b633ad43..f9d4d773 100644 --- a/root/io/io/TFile_CompressionBenchmarks_MainEvent.cxx +++ b/root/io/io/TFile_CompressionBenchmarks_MainEvent.cxx @@ -13,7 +13,8 @@ static std::string GetAlgoName(int algo) { {1, "zlib"}, {2, "lzma"}, {4, "lz4"}, - {5, "zstd"} + {5, "zstd"}, + {6, "flzma2"} }; if (algoName.find(algo) != algoName.end()) @@ -87,6 +88,9 @@ static void BM_MainEvent_Compress_LZ4(benchmark::State &state) { static void BM_MainEvent_Compress_ZSTD(benchmark::State &state) { BM_MainEvent_Compress(state, 5); } +static void BM_MainEvent_Compress_FLZMA2(benchmark::State &state) { + BM_MainEvent_Compress(state, 6); +} static void BM_MainEvent_Decompress_ZLIB(benchmark::State &state) { @@ -101,7 +105,9 @@ static void BM_MainEvent_Decompress_LZ4(benchmark::State &state) { static void BM_MainEvent_Decompress_ZSTD(benchmark::State &state) { BM_MainEvent_Decompress(state, 5); } - +static void BM_MainEvent_Decompress_FLZMA2(benchmark::State &state) { + BM_MainEvent_Decompress(state, 6); +} BENCHMARK(BM_MainEvent_Compress_ZLIB) @@ -120,6 +126,10 @@ BENCHMARK(BM_MainEvent_Compress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) ->Unit(benchmark::kMillisecond)->Iterations(5); +BENCHMARK(BM_MainEvent_Compress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(5); + BENCHMARK(BM_MainEvent_Decompress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) @@ -137,5 +147,10 @@ BENCHMARK(BM_MainEvent_Decompress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) ->Unit(benchmark::kMillisecond)->Iterations(5); +BENCHMARK(BM_MainEvent_Decompress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(5); + + BENCHMARK_MAIN(); diff --git a/root/io/io/TFile_LHCb_Benchmarks.cxx b/root/io/io/TFile_LHCb_Benchmarks.cxx index 5e1e026c..35a0b49e 100644 --- a/root/io/io/TFile_LHCb_Benchmarks.cxx +++ b/root/io/io/TFile_LHCb_Benchmarks.cxx @@ -11,7 +11,8 @@ static std::string GetAlgoName(int algo) { {1, "zlib"}, {2, "lzma"}, {4, "lz4"}, - {5, "zstd"} + {5, "zstd"}, + {6, "flzma2"} }; if (algoName.find(algo) != algoName.end()) @@ -93,6 +94,9 @@ static void BM_LHCb_Compress_LZ4(benchmark::State &state) { static void BM_LHCb_Compress_ZSTD(benchmark::State &state) { BM_LHCb_Compress(state, 5); } +static void BM_LHCb_Compress_FLZMA2(benchmark::State &state) { + BM_LHCb_Compress(state, 6); +} static void BM_LHCb_Decompress_ZLIB(benchmark::State &state) { BM_LHCb_Decompress(state, 1); @@ -106,6 +110,9 @@ static void BM_LHCb_Decompress_LZ4(benchmark::State &state) { static void BM_LHCb_Decompress_ZSTD(benchmark::State &state) { BM_LHCb_Decompress(state, 5); } +static void BM_LHCb_Decompress_FLZMA2(benchmark::State &state) { + BM_LHCb_Decompress(state, 6); +} BENCHMARK(BM_LHCb_Compress_ZLIB) @@ -124,6 +131,9 @@ BENCHMARK(BM_LHCb_Compress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) ->Unit(benchmark::kMillisecond)->Iterations(5); +BENCHMARK(BM_LHCb_Compress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(5); BENCHMARK(BM_LHCb_Decompress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) @@ -141,5 +151,9 @@ BENCHMARK(BM_LHCb_Decompress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) ->Unit(benchmark::kMillisecond)->Iterations(5); +BENCHMARK(BM_LHCb_Decompress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(5); + BENCHMARK_MAIN(); \ No newline at end of file diff --git a/root/io/io/TFile_NanoAOD_Benchmarks.cxx b/root/io/io/TFile_NanoAOD_Benchmarks.cxx index 52671578..a15558a7 100644 --- a/root/io/io/TFile_NanoAOD_Benchmarks.cxx +++ b/root/io/io/TFile_NanoAOD_Benchmarks.cxx @@ -11,7 +11,8 @@ static std::string GetAlgoName(int algo) { {1, "zlib"}, {2, "lzma"}, {4, "lz4"}, - {5, "zstd"} + {5, "zstd"}, + {6, "flzma2"} }; if (algoName.find(algo) != algoName.end()) @@ -77,6 +78,9 @@ static void BM_NanoAOD_Compress_LZ4(benchmark::State &state) { static void BM_NanoAOD_Compress_ZSTD(benchmark::State &state) { BM_NanoAOD_Compress(state, 5); } +static void BM_NanoAOD_Compress_FLZMA2(benchmark::State &state) { + BM_NanoAOD_Compress(state, 6); +} static void BM_NanoAOD_Decompress_ZLIB(benchmark::State &state) { BM_NanoAOD_Decompress(state, 1); @@ -90,6 +94,9 @@ static void BM_NanoAOD_Decompress_LZ4(benchmark::State &state) { static void BM_NanoAOD_Decompress_ZSTD(benchmark::State &state) { BM_NanoAOD_Decompress(state, 5); } +static void BM_NanoAOD_Decompress_FLZMA2(benchmark::State &state) { + BM_NanoAOD_Decompress(state, 6); +} BENCHMARK(BM_NanoAOD_Compress_ZLIB) @@ -108,6 +115,10 @@ BENCHMARK(BM_NanoAOD_Compress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) ->Unit(benchmark::kMillisecond)->Iterations(5); +BENCHMARK(BM_NanoAOD_Compress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(5); + BENCHMARK(BM_NanoAOD_Decompress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) @@ -125,5 +136,9 @@ BENCHMARK(BM_NanoAOD_Decompress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) ->Unit(benchmark::kMillisecond)->Iterations(5); +BENCHMARK(BM_NanoAOD_Decompress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(5); + BENCHMARK_MAIN(); diff --git a/root/io/io/TFile_RDFSnapshot.cxx b/root/io/io/TFile_RDFSnapshot.cxx index fed7ad90..a7077c0d 100644 --- a/root/io/io/TFile_RDFSnapshot.cxx +++ b/root/io/io/TFile_RDFSnapshot.cxx @@ -65,4 +65,14 @@ static void BM_TFile_RDFSnapshot_ZSTD (benchmark::State &state) { } BENCHMARK(BM_TFile_RDFSnapshot_ZSTD)->Unit(benchmark::kMicrosecond); +static void BM_TFile_RDFSnapshot_FLZMA2 (benchmark::State &state) { + auto tdf = SetupRDF(); + auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kFLZMA2, 6); + for (auto _ : state) { + //And we write out the dataset on disk + tdf.Snapshot("randomNumbers", "bench_data.root", {"rnd"}, options); + } +} +BENCHMARK(BM_TFile_RDFSnapshot_FLZMA2)->Unit(benchmark::kMicrosecond); + BENCHMARK_MAIN(); From 812403fb25b0bb3ec5704d737b61ad12131d1025 Mon Sep 17 00:00:00 2001 From: Oksana Shadura Date: Sun, 21 Mar 2021 14:46:38 +0100 Subject: [PATCH 2/4] Improved benchmarking of compression algorithms I added a new CMake option: experiment-datafiles - that allows to download experiments files (CMS, ATLAS) that are bigger then 1.5 GB --- root/io/io/CMakeLists.txt | 36 +++++----- root/io/io/TFile_ATLAS_Benchmarks.cxx | 78 +++++++++++++------- root/io/io/TFile_LHCb_Benchmarks.cxx | 72 +++++++++++-------- root/io/io/TFile_NanoAOD_Benchmarks.cxx | 64 ++++++++++------- root/io/io/TFile_RDFSnapshot.cxx | 94 ++++++++++++++++++++----- root/tree/tree/RNTupleH1Benchmarks.cxx | 2 + 6 files changed, 226 insertions(+), 120 deletions(-) diff --git a/root/io/io/CMakeLists.txt b/root/io/io/CMakeLists.txt index fe1c7fe9..4c4f8433 100644 --- a/root/io/io/CMakeLists.txt +++ b/root/io/io/CMakeLists.txt @@ -7,10 +7,11 @@ if(ROOT_root7_FOUND) # using ROOT_root7_FOUND as a proxy for "c++ standard >= 14 RB_ADD_GBENCHMARK(TFile_RDFSnapshot TFile_RDFSnapshot.cxx LABEL short - LIBRARIES Core RIO ROOTDataFrame Tree TreePlayer MathCore) + LIBRARIES Core RIO ROOTDataFrame Tree TreePlayer MathCore) endif() -if(rootbench-datafiles) +if(rootbench-datafiles AND experiment-datafiles) + # FIXME:Compression tests needs to have libEvent.so which is a part of ROOT build # Preloading doesn't help... #if(TARGET Event) @@ -21,22 +22,21 @@ if(rootbench-datafiles) # DOWNLOAD_DATAFILES Event0-sample.root) #endif() - # FIXME: too long benchmarks, needs to be optimised - #RB_ADD_GBENCHMARK(CompressionBenchmarks_LHCb - # TFile_LHCb_Benchmarks.cxx - # LABEL short - # LIBRARIES Core RIO - # DOWNLOAD_DATAFILES lhcb_B2ppKK2011_md_noPIDstrip.root) + RB_ADD_GBENCHMARK(CompressionBenchmarks_LHCb + TFile_LHCb_Benchmarks.cxx + LABEL short + LIBRARIES Core RIO Tree + DOWNLOAD_DATAFILES lhcb_B2ppKK2011_md_noPIDstrip.root) - #RB_ADD_GBENCHMARK(CompressionBenchmarks_NanoAOD - # TFile_NanoAOD_Benchmarks.cxx - # LABEL short - # LIBRARIES Core RIO - # DOWNLOAD_DATAFILES Run2012B_DoubleMuParked.root) + RB_ADD_GBENCHMARK(CompressionBenchmarks_NanoAOD + TFile_NanoAOD_Benchmarks.cxx + LABEL short + LIBRARIES Core RIO Tree + DOWNLOAD_DATAFILES NanoAOD_DoubleMuon_CMS2011OpenData.root) - #RB_ADD_GBENCHMARK(CompressionBenchmarks_ATLAS - # TFile_ATLAS_Benchmarks.cxx - # LABEL short - # LIBRARIES Core RIO - # DOWNLOAD_DATAFILES gg_data-zstd.root) + RB_ADD_GBENCHMARK(CompressionBenchmarks_ATLAS + TFile_ATLAS_Benchmarks.cxx + LABEL short + LIBRARIES Core RIO Tree + DOWNLOAD_DATAFILES gg_data-zstd.root) endif() diff --git a/root/io/io/TFile_ATLAS_Benchmarks.cxx b/root/io/io/TFile_ATLAS_Benchmarks.cxx index 7ef06cb9..efcaa6c1 100644 --- a/root/io/io/TFile_ATLAS_Benchmarks.cxx +++ b/root/io/io/TFile_ATLAS_Benchmarks.cxx @@ -1,10 +1,12 @@ #include "TFile.h" #include "TTree.h" +#include "TStopwatch.h" #include "benchmark/benchmark.h" #include "rootbench/RBConfig.h" #include +#include static std::string GetAlgoName(int algo) { std::map algoName = { @@ -22,47 +24,57 @@ static std::string GetAlgoName(int algo) { } static void BM_ATLAS_Compress(benchmark::State &state, int algo) { - TFile *oldfile = new TFile((RB::GetDataDir() + "/gg_data-zstd.root").c_str()); - TTree *oldtree = (TTree*)oldfile->Get("mini"); - + std::string path = RB::GetDataDir() + "/gg_data-zstd.root"; + auto oldfile = TFile::Open(path.c_str()); + auto oldtree = oldfile->Get("mini"); + TStopwatch timer; + const auto nevents = oldtree->GetEntries(); int comp_level = state.range(0); std::string filename = "level_" + std::to_string(comp_level) + "_atlas_" + GetAlgoName(algo) + ".root"; for (auto _ : state) { state.PauseTiming(); - - TFile *newfile = new TFile(filename.c_str(), "recreate"); - TTree *newtree = oldtree->CloneTree(); + auto newfile = new TFile(filename.c_str(), "recreate"); newfile->SetCompressionAlgorithm(algo); newfile->SetCompressionLevel(comp_level); + auto newtree = oldtree->CloneTree(); state.ResumeTiming(); + timer.Start(); newfile->Write(); + timer.Stop(); state.PauseTiming(); - state.counters["comp_size"] = newfile->GetBytesWritten(); + state.counters["comp_size"] = newfile->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = newfile->GetSize()/rtime; + state.counters["mb_cts"] = newfile->GetSize()/ctime; newfile->Close(); - state.ResumeTiming(); } } static void BM_ATLAS_Decompress(benchmark::State &state, int algo) { int comp_level = state.range(0); - + int nb; + TStopwatch timer; std::string filename = "level_" + std::to_string(comp_level) + "_atlas_" + GetAlgoName(algo) + ".root"; for (auto _ : state) { - TFile *hfile = new TFile(filename.c_str()); - TTree *tree = (TTree*)hfile->Get("mini"); - - Int_t nevent = (Int_t)tree->GetEntries(); - - Int_t nb = 0; + timer.Start(); + TFile f(filename.c_str()); + auto tree = static_cast(f.Get("mini")); + const auto nevents = tree->GetEntries(); Int_t ev; - - for (ev = 0; ev < nevent; ev++) { + for (ev = 0; ev < nevents; ++ev) { nb += tree->GetEntry(ev); } + timer.Stop(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = f.GetSize()/rtime; + state.counters["mb_cts"] = f.GetSize()/ctime; + f.Close(); } } @@ -78,6 +90,9 @@ static void BM_ATLAS_Compress_LZ4(benchmark::State &state) { static void BM_ATLAS_Compress_ZSTD(benchmark::State &state) { BM_ATLAS_Compress(state, 5); } +static void BM_ATLAS_Compress_FLZMA2(benchmark::State &state) { + BM_ATLAS_Compress(state, 6); +} static void BM_ATLAS_Decompress_ZLIB(benchmark::State &state) { BM_ATLAS_Decompress(state, 1); @@ -91,40 +106,51 @@ static void BM_ATLAS_Decompress_LZ4(benchmark::State &state) { static void BM_ATLAS_Decompress_ZSTD(benchmark::State &state) { BM_ATLAS_Decompress(state, 5); } - +static void BM_ATLAS_Decompress_FLZMA2(benchmark::State &state) { + BM_ATLAS_Decompress(state, 6); +} BENCHMARK(BM_ATLAS_Compress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_ATLAS_Compress_LZMA) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_ATLAS_Compress_LZ4) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_ATLAS_Compress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); + +BENCHMARK(BM_ATLAS_Compress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(1); + BENCHMARK(BM_ATLAS_Decompress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_ATLAS_Decompress_LZMA) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_ATLAS_Decompress_LZ4) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_ATLAS_Decompress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); + +BENCHMARK(BM_ATLAS_Decompress_FLZMA2) +->Arg(1)->Arg(6)->Arg(9) +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK_MAIN(); \ No newline at end of file diff --git a/root/io/io/TFile_LHCb_Benchmarks.cxx b/root/io/io/TFile_LHCb_Benchmarks.cxx index 35a0b49e..6f6e56f2 100644 --- a/root/io/io/TFile_LHCb_Benchmarks.cxx +++ b/root/io/io/TFile_LHCb_Benchmarks.cxx @@ -1,5 +1,6 @@ #include "TFile.h" #include "TTree.h" +#include "TStopwatch.h" #include "benchmark/benchmark.h" #include "rootbench/RBConfig.h" @@ -22,6 +23,7 @@ static std::string GetAlgoName(int algo) { } static void BM_LHCb_Compress(benchmark::State &state, int algo) { + TStopwatch timer; TFile *oldfile = new TFile((RB::GetDataDir() + "/lhcb_B2ppKK2011_md_noPIDstrip.root").c_str()); TTree *oldtree1 = (TTree*)oldfile->Get("TupleB2ppKK/DecayTree"); TTree *oldtree2 = (TTree*)oldfile->Get("TupleB2ppKPi/DecayTree"); @@ -32,19 +34,24 @@ static void BM_LHCb_Compress(benchmark::State &state, int algo) { for (auto _ : state) { state.PauseTiming(); - - TFile *newfile = new TFile(filename.c_str(), "recreate"); - TTree *newtree1 = oldtree1->CloneTree(); - TTree *newtree2 = oldtree2->CloneTree(); - TTree *newtree3 = oldtree3->CloneTree(); + auto newfile = new TFile(filename.c_str(), "recreate"); newfile->SetCompressionAlgorithm(algo); newfile->SetCompressionLevel(comp_level); + auto newtree1 = oldtree1->CloneTree(); + auto newtree2 = oldtree2->CloneTree(); + auto newtree3 = oldtree3->CloneTree(); state.ResumeTiming(); + timer.Start(); newfile->Write(); + timer.Stop(); state.PauseTiming(); - state.counters["comp_size"] = newfile->GetBytesWritten(); + state.counters["comp_size"] = newfile->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = newfile->GetSize()/rtime; + state.counters["mb_cts"] = newfile->GetSize()/ctime; newfile->Close(); state.ResumeTiming(); @@ -53,32 +60,35 @@ static void BM_LHCb_Compress(benchmark::State &state, int algo) { static void BM_LHCb_Decompress(benchmark::State &state, int algo) { int comp_level = state.range(0); - + TStopwatch timer; std::string filename = "level_" + std::to_string(comp_level) + "_lhcb_" + GetAlgoName(algo) + ".root"; for (auto _ : state) { - TFile *hfile = new TFile(filename.c_str()); - TTree *tree1 = (TTree*)hfile->Get("TupleB2ppKK/DecayTree"); - TTree *tree2 = (TTree*)hfile->Get("TupleB2ppKPi/DecayTree"); - TTree *tree3 = (TTree*)hfile->Get("TupleB2ppPiPi/DecayTree"); - - Int_t nevent1 = (Int_t)tree1->GetEntries(); - Int_t nevent2 = (Int_t)tree2->GetEntries(); - Int_t nevent3 = (Int_t)tree3->GetEntries(); + timer.Start(); + TFile f(filename.c_str()); + auto tree1 = static_cast(f.Get("TupleB2ppKK/DecayTree")); + auto tree2 = static_cast(f.Get("TupleB2ppKPi/DecayTree")); + auto tree3 = static_cast(f.Get("TupleB2ppPiPi/DecayTree")); + const auto nevent1 = tree1->GetEntries(); + const auto nevent2 = tree2->GetEntries(); + const auto nevent3 = tree3->GetEntries(); Int_t nb = 0; Int_t ev; - - for (ev = 0; ev < nevent1; ev++) { + for (ev = 0; ev < nevent1; ++ev) { nb += tree1->GetEntry(ev); } - - for (ev = 0; ev < nevent2; ev++) { + for (ev = 0; ev < nevent2; ++ev) { nb += tree2->GetEntry(ev); } - - for (ev = 0; ev < nevent3; ev++) { + for (ev = 0; ev < nevent3; ++ev) { nb += tree3->GetEntry(ev); } + timer.Stop(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = f.GetSize()/rtime; + state.counters["mb_cts"] = f.GetSize()/ctime; + f.Close(); } } @@ -117,43 +127,43 @@ static void BM_LHCb_Decompress_FLZMA2(benchmark::State &state) { BENCHMARK(BM_LHCb_Compress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Compress_LZMA) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Compress_LZ4) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Compress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Compress_FLZMA2) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Decompress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Decompress_LZMA) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Decompress_LZ4) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Decompress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_LHCb_Decompress_FLZMA2) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK_MAIN(); \ No newline at end of file diff --git a/root/io/io/TFile_NanoAOD_Benchmarks.cxx b/root/io/io/TFile_NanoAOD_Benchmarks.cxx index a15558a7..3f1ebe5e 100644 --- a/root/io/io/TFile_NanoAOD_Benchmarks.cxx +++ b/root/io/io/TFile_NanoAOD_Benchmarks.cxx @@ -1,5 +1,6 @@ #include "TFile.h" #include "TTree.h" +#include "TStopwatch.h" #include "benchmark/benchmark.h" #include "rootbench/RBConfig.h" @@ -22,47 +23,58 @@ static std::string GetAlgoName(int algo) { } static void BM_NanoAOD_Compress(benchmark::State &state, int algo) { - TFile *oldfile = new TFile((RB::GetDataDir() + "/Run2012B_DoubleMuParked.root").c_str()); - TTree *oldtree = (TTree*)oldfile->Get("Events"); - + std::string path = RB::GetDataDir() + "/NanoAOD_DoubleMuon_CMS2011OpenData.root"; + auto oldfile = TFile::Open(path.c_str()); + auto oldtree = oldfile->Get("Events"); + TStopwatch timer; + const auto nevents = oldtree->GetEntries(); int comp_level = state.range(0); std::string filename = "level_" + std::to_string(comp_level) + "_nanoaod_" + GetAlgoName(algo) + ".root"; for (auto _ : state) { state.PauseTiming(); - TFile *newfile = new TFile(filename.c_str(), "recreate"); - TTree *newtree = oldtree->CloneTree(); + auto newfile = new TFile(filename.c_str(), "recreate"); newfile->SetCompressionAlgorithm(algo); newfile->SetCompressionLevel(comp_level); + auto newtree = oldtree->CloneTree(); state.ResumeTiming(); + timer.Start(); newfile->Write(); + timer.Stop(); state.PauseTiming(); - state.counters["comp_size"] = newfile->GetBytesWritten(); + state.counters["comp_size"] = newfile->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = newfile->GetSize()/rtime; + state.counters["mb_cts"] = newfile->GetSize()/ctime; newfile->Close(); - state.ResumeTiming(); } } static void BM_NanoAOD_Decompress(benchmark::State &state, int algo) { int comp_level = state.range(0); - + int nb; + TStopwatch timer; std::string filename = "level_" + std::to_string(comp_level) + "_nanoaod_" + GetAlgoName(algo) + ".root"; for (auto _ : state) { - TFile *hfile = new TFile(filename.c_str()); - TTree *tree = (TTree*)hfile->Get("Events"); - - Int_t nevent = (Int_t)tree->GetEntries(); - - Int_t nb = 0; + timer.Start(); + TFile f(filename.c_str()); + auto tree = static_cast(f.Get("Events")); + const auto nevents = tree->GetEntries(); Int_t ev; - - for (ev = 0; ev < nevent; ev++) { + for (ev = 0; ev < nevents; ++ev) { nb += tree->GetEntry(ev); } + timer.Stop(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = f.GetSize()/rtime; + state.counters["mb_cts"] = f.GetSize()/ctime; + f.Close(); } } @@ -101,44 +113,44 @@ static void BM_NanoAOD_Decompress_FLZMA2(benchmark::State &state) { BENCHMARK(BM_NanoAOD_Compress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Compress_LZMA) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Compress_LZ4) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Compress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Compress_FLZMA2) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Decompress_ZLIB) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Decompress_LZMA) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Decompress_LZ4) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Decompress_ZSTD) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK(BM_NanoAOD_Decompress_FLZMA2) ->Arg(1)->Arg(6)->Arg(9) -->Unit(benchmark::kMillisecond)->Iterations(5); +->Unit(benchmark::kMillisecond)->Iterations(1); BENCHMARK_MAIN(); diff --git a/root/io/io/TFile_RDFSnapshot.cxx b/root/io/io/TFile_RDFSnapshot.cxx index a7077c0d..a178b4f6 100644 --- a/root/io/io/TFile_RDFSnapshot.cxx +++ b/root/io/io/TFile_RDFSnapshot.cxx @@ -1,14 +1,15 @@ #include "ROOT/RDataFrame.hxx" #include "ROOT/RSnapshotOptions.hxx" #include "TRandom3.h" +#include "TStopwatch.h" #include "benchmark/benchmark.h" #include "rootbench/RBConfig.h" -auto SetupRDF() { +auto SetupRDF(int size) { // We create an empty data frame - ROOT::RDataFrame tdf(100000); + ROOT::RDataFrame tdf(size); // We now fill it with random numbers gRandom->SetSeed(1); auto tdf_1 = tdf.Define("rnd", []() { return gRandom->Gaus(); }); @@ -24,55 +25,110 @@ auto SetupRDFOptions(ROOT::ECompressionAlgorithm alg, int level) { static void BM_TFile_RDFSnapshot_ZLIB(benchmark::State &state) { - auto tdf = SetupRDF(); - auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kZLIB, 1); + TStopwatch timer; + int size = 50000000; + auto tdf = SetupRDF(size); + int comp_level = state.range(0); + auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kZLIB, comp_level); for (auto _ : state) { //And we write out the dataset on disk + timer.Start(); tdf.Snapshot("randomNumbers", "bench_data.root", {"rnd"}, options); + timer.Stop(); + auto file = TFile::Open("bench_data.root"); + state.counters["comp_size"] = file->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = file->GetSize()/rtime; + state.counters["mb_cts"] = file->GetSize()/ctime; } } -BENCHMARK(BM_TFile_RDFSnapshot_ZLIB)->Unit(benchmark::kMicrosecond); +BENCHMARK(BM_TFile_RDFSnapshot_ZLIB)->Arg(1)->Arg(6)->Arg(9)->Unit(benchmark::kMicrosecond); static void BM_TFile_RDFSnapshot_LZ4(benchmark::State &state) { - auto tdf = SetupRDF(); - auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kLZ4, 4); + TStopwatch timer; + int size = 50000000; + auto tdf = SetupRDF(size); + int comp_level = state.range(0); + auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kLZ4, comp_level); for (auto _ : state) { //And we write out the dataset on disk + timer.Start(); tdf.Snapshot("randomNumbers", "bench_data.root", {"rnd"}, options); + timer.Stop(); + auto file = TFile::Open("bench_data.root"); + state.counters["comp_size"] = file->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = file->GetSize()/rtime; + state.counters["mb_cts"] = file->GetSize()/ctime; } } -BENCHMARK(BM_TFile_RDFSnapshot_LZ4)->Unit(benchmark::kMicrosecond); +BENCHMARK(BM_TFile_RDFSnapshot_LZ4)->Arg(1)->Arg(6)->Arg(9)->Unit(benchmark::kMicrosecond); static void BM_TFile_RDFSnapshot_LZMA (benchmark::State &state) { - auto tdf = SetupRDF(); - auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kLZMA, 8); + TStopwatch timer; + int size = 50000000; + auto tdf = SetupRDF(size); + int comp_level = state.range(0); + auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kLZMA, comp_level); for (auto _ : state) { //And we write out the dataset on disk + timer.Start(); tdf.Snapshot("randomNumbers", "bench_data.root", {"rnd"}, options); + timer.Stop(); + auto file = TFile::Open("bench_data.root"); + state.counters["comp_size"] = file->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = file->GetSize()/rtime; + state.counters["mb_cts"] = file->GetSize()/ctime; } } -BENCHMARK(BM_TFile_RDFSnapshot_LZMA)->Unit(benchmark::kMicrosecond); +BENCHMARK(BM_TFile_RDFSnapshot_LZMA)->Arg(1)->Arg(6)->Arg(9)->Unit(benchmark::kMicrosecond); -static void BM_TFile_RDFSnapshot_ZSTD (benchmark::State &state) { - auto tdf = SetupRDF(); - auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kZSTD, 6); +static void BM_TFile_RDFSnapshot_FLZMA2 (benchmark::State &state) { + TStopwatch timer; + int size = 50000000; + auto tdf = SetupRDF(size); + int comp_level = state.range(0); + auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kFLZMA2, comp_level); for (auto _ : state) { //And we write out the dataset on disk + timer.Start(); tdf.Snapshot("randomNumbers", "bench_data.root", {"rnd"}, options); + timer.Stop(); + auto file = TFile::Open("bench_data.root"); + state.counters["comp_size"] = file->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = file->GetSize()/rtime; + state.counters["mb_cts"] = file->GetSize()/ctime; } } -BENCHMARK(BM_TFile_RDFSnapshot_ZSTD)->Unit(benchmark::kMicrosecond); +BENCHMARK(BM_TFile_RDFSnapshot_FLZMA2)->Arg(1)->Arg(6)->Arg(9)->Unit(benchmark::kMicrosecond); -static void BM_TFile_RDFSnapshot_FLZMA2 (benchmark::State &state) { - auto tdf = SetupRDF(); - auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kFLZMA2, 6); +static void BM_TFile_RDFSnapshot_ZSTD (benchmark::State &state) { + TStopwatch timer; + int size = 50000000; + auto tdf = SetupRDF(size); + int comp_level = state.range(0); + auto options = SetupRDFOptions(ROOT::ECompressionAlgorithm::kZSTD, comp_level); for (auto _ : state) { //And we write out the dataset on disk + timer.Start(); tdf.Snapshot("randomNumbers", "bench_data.root", {"rnd"}, options); + timer.Stop(); + auto file = TFile::Open("bench_data.root"); + state.counters["comp_size"] = file->GetSize(); + double rtime = timer.RealTime(); + double ctime = timer.CpuTime(); + state.counters["mb_rts"] = file->GetSize()/rtime; + state.counters["mb_cts"] = file->GetSize()/ctime; } } -BENCHMARK(BM_TFile_RDFSnapshot_FLZMA2)->Unit(benchmark::kMicrosecond); +BENCHMARK(BM_TFile_RDFSnapshot_ZSTD)->Arg(1)->Arg(6)->Arg(9)->Arg(20)->Arg(22)->Unit(benchmark::kMicrosecond); BENCHMARK_MAIN(); diff --git a/root/tree/tree/RNTupleH1Benchmarks.cxx b/root/tree/tree/RNTupleH1Benchmarks.cxx index 0f4645e0..244da37f 100644 --- a/root/tree/tree/RNTupleH1Benchmarks.cxx +++ b/root/tree/tree/RNTupleH1Benchmarks.cxx @@ -103,6 +103,7 @@ BENCHMARK_CAPTURE(BM_RNTuple_H1, BM_RNTuple_H1LZ4, "lz4")->Unit(benchmark::kMicr BENCHMARK_CAPTURE(BM_RNTuple_H1, BM_RNTuple_H1ZLIB, "zlib")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_RNTuple_H1, BM_RNTuple_H1LZMA, "lzma")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_RNTuple_H1, BM_RNTuple_H1ZSTD, "zstd")->Unit(benchmark::kMicrosecond)->Iterations(5); +BENCHMARK_CAPTURE(BM_RNTuple_H1, BM_RNTuple_H1FLZMA2, "flzma2")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_RNTuple_H1, BM_RNTuple_H1None, "none")->Unit(benchmark::kMicrosecond)->Iterations(5); static void BM_TTree_H1(benchmark::State &state, const std::string &comprAlgorithm) @@ -229,6 +230,7 @@ BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1LZ4, "lz4")->Unit(benchmark::kMicrosec BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1ZLIB, "zlib")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1LZMA, "lzma")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1ZSTD, "zstd")->Unit(benchmark::kMicrosecond)->Iterations(5); +BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1FLZMA2, "flzma2")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1None, "none")->Unit(benchmark::kMicrosecond)->Iterations(5); BENCHMARK_MAIN(); From 36d12e0282de8dc0fdb990ca962766ef1e83d004 Mon Sep 17 00:00:00 2001 From: Oksana Shadura Date: Sun, 21 Mar 2021 15:21:42 +0100 Subject: [PATCH 3/4] Actually add a file with changes for a new Cmake option --- cmake/modules/RootBenchOptions.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/modules/RootBenchOptions.cmake b/cmake/modules/RootBenchOptions.cmake index 9829657d..d2563057 100644 --- a/cmake/modules/RootBenchOptions.cmake +++ b/cmake/modules/RootBenchOptions.cmake @@ -4,4 +4,11 @@ # # TBD: to introduce special function for options (similar to root.git) #---------------------------------------------------------------------------- option(coverage OFF) -option(rootbench-datafiles OFF) \ No newline at end of file + +option(rootbench-datafiles OFF "Download files from root.cern.ch") + +option(experiment-datafiles OFF "Use for benchmarking CMS and ATLAS files (> 1.5 GB)") +if(experiment-datafiles) + # We need to enable download of datafiles from oot.cern.ch + set(rootbench-datafiles ON CACHE BOOL "Download files from root.cern.ch" FORCE) +endif() \ No newline at end of file From d015f1f6a888d39ebf3f6e9ec1cd14a42b7256f6 Mon Sep 17 00:00:00 2001 From: Oksana Shadura Date: Tue, 23 Mar 2021 13:41:18 +0100 Subject: [PATCH 4/4] Add LZMA2 to test RNTuple as well --- root/io/io/CMakeLists.txt | 2 +- root/io/io/TFile_NanoAOD_Benchmarks.cxx | 19 ++++++++++++++----- root/tree/tree/CMakeLists.txt | 2 ++ root/tree/tree/RNTupleH1Benchmarks.cxx | 12 ++++++------ root/tree/tree/gen_h1.cxx | 2 ++ 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/root/io/io/CMakeLists.txt b/root/io/io/CMakeLists.txt index 4c4f8433..590c5b47 100644 --- a/root/io/io/CMakeLists.txt +++ b/root/io/io/CMakeLists.txt @@ -32,7 +32,7 @@ if(rootbench-datafiles AND experiment-datafiles) TFile_NanoAOD_Benchmarks.cxx LABEL short LIBRARIES Core RIO Tree - DOWNLOAD_DATAFILES NanoAOD_DoubleMuon_CMS2011OpenData.root) + DOWNLOAD_DATAFILES Run2012B_DoubleMuParked.root NanoAOD_DoubleMuon_CMS2011OpenData.root) RB_ADD_GBENCHMARK(CompressionBenchmarks_ATLAS TFile_ATLAS_Benchmarks.cxx diff --git a/root/io/io/TFile_NanoAOD_Benchmarks.cxx b/root/io/io/TFile_NanoAOD_Benchmarks.cxx index 3f1ebe5e..37db9e13 100644 --- a/root/io/io/TFile_NanoAOD_Benchmarks.cxx +++ b/root/io/io/TFile_NanoAOD_Benchmarks.cxx @@ -23,7 +23,8 @@ static std::string GetAlgoName(int algo) { } static void BM_NanoAOD_Compress(benchmark::State &state, int algo) { - std::string path = RB::GetDataDir() + "/NanoAOD_DoubleMuon_CMS2011OpenData.root"; + std::string path = RB::GetDataDir() + "/Run2012B_DoubleMuParked.root"; + //std::string path = RB::GetDataDir() + "/NanoAOD_DoubleMuon_CMS2011OpenData.root"; auto oldfile = TFile::Open(path.c_str()); auto oldtree = oldfile->Get("Events"); TStopwatch timer; @@ -48,8 +49,12 @@ static void BM_NanoAOD_Compress(benchmark::State &state, int algo) { state.counters["comp_size"] = newfile->GetSize(); double rtime = timer.RealTime(); double ctime = timer.CpuTime(); - state.counters["mb_rts"] = newfile->GetSize()/rtime; - state.counters["mb_cts"] = newfile->GetSize()/ctime; + // For Run2012B_DoubleMuParked.root: + float size_mb = 774.619423; + // For NanoAOD_DoubleMuon_CMS2011OpenData.root: + //float size_mb = 774.619423; + state.counters["mb_rts"] = size_mb/rtime; + state.counters["mb_cts"] = size_mb/ctime; newfile->Close(); state.ResumeTiming(); } @@ -72,8 +77,12 @@ static void BM_NanoAOD_Decompress(benchmark::State &state, int algo) { timer.Stop(); double rtime = timer.RealTime(); double ctime = timer.CpuTime(); - state.counters["mb_rts"] = f.GetSize()/rtime; - state.counters["mb_cts"] = f.GetSize()/ctime; + // For Run2012B_DoubleMuParked.root: + float size_mb = 774.619423; + // For NanoAOD_DoubleMuon_CMS2011OpenData.root: + //float size_mb = 4871.365001; + state.counters["mb_rts"] = size_mb/rtime; + state.counters["mb_cts"] = size_mb/ctime; f.Close(); } } diff --git a/root/tree/tree/CMakeLists.txt b/root/tree/tree/CMakeLists.txt index 5a87ab39..bf7bfc2c 100644 --- a/root/tree/tree/CMakeLists.txt +++ b/root/tree/tree/CMakeLists.txt @@ -27,10 +27,12 @@ if(ROOT_root7_FOUND AND rootbench-datafiles) SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_h1 -o ${RB_DATASETDIR} -c lzma ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_h1 -o ${RB_DATASETDIR} -c lz4 ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_h1 -o ${RB_DATASETDIR} -c zstd ${RB_DATASETDIR}/h1dst-lzma.root" + SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_h1 -o ${RB_DATASETDIR} -c flzma2 ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "${CMAKE_CURRENT_BINARY_DIR}/gen_h1 -o ${RB_DATASETDIR} -c none ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "hadd -f101 ${RB_DATASETDIR}/h1dst-zlib.root ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "hadd -f404 ${RB_DATASETDIR}/h1dst-lz4.root ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "hadd -f506 ${RB_DATASETDIR}/h1dst-zstd.root ${RB_DATASETDIR}/h1dst-lzma.root" + SETUP "hadd -f606 ${RB_DATASETDIR}/h1dst-flzma2.root ${RB_DATASETDIR}/h1dst-lzma.root" SETUP "hadd -f0 ${RB_DATASETDIR}/h1dst-none.root ${RB_DATASETDIR}/h1dst-lzma.root") RB_ADD_GBENCHMARK(RNTupleLHCBBenchmarks diff --git a/root/tree/tree/RNTupleH1Benchmarks.cxx b/root/tree/tree/RNTupleH1Benchmarks.cxx index 244da37f..b2451d3b 100644 --- a/root/tree/tree/RNTupleH1Benchmarks.cxx +++ b/root/tree/tree/RNTupleH1Benchmarks.cxx @@ -226,11 +226,11 @@ static void BM_TTree_H1(benchmark::State &state, const std::string &comprAlgorit delete h2; } } -BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1LZ4, "lz4")->Unit(benchmark::kMicrosecond)->Iterations(5); -BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1ZLIB, "zlib")->Unit(benchmark::kMicrosecond)->Iterations(5); -BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1LZMA, "lzma")->Unit(benchmark::kMicrosecond)->Iterations(5); -BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1ZSTD, "zstd")->Unit(benchmark::kMicrosecond)->Iterations(5); -BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1FLZMA2, "flzma2")->Unit(benchmark::kMicrosecond)->Iterations(5); -BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1None, "none")->Unit(benchmark::kMicrosecond)->Iterations(5); +BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1LZ4, "lz4")->Unit(benchmark::kMicrosecond)->Iterations(3); +BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1ZLIB, "zlib")->Unit(benchmark::kMicrosecond)->Iterations(3); +BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1LZMA, "lzma")->Unit(benchmark::kMicrosecond)->Iterations(3); +BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1ZSTD, "zstd")->Unit(benchmark::kMicrosecond)->Iterations(3); +BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1FLZMA2, "flzma2")->Unit(benchmark::kMicrosecond)->Iterations(3); +BENCHMARK_CAPTURE(BM_TTree_H1, BM_TTree_H1None, "none")->Unit(benchmark::kMicrosecond)->Iterations(3); BENCHMARK_MAIN(); diff --git a/root/tree/tree/gen_h1.cxx b/root/tree/tree/gen_h1.cxx index e676d7b2..a21dda7b 100644 --- a/root/tree/tree/gen_h1.cxx +++ b/root/tree/tree/gen_h1.cxx @@ -55,6 +55,8 @@ int GetCompressionSettings(std::string shorthand) return 207; if (shorthand == "zstd") return 505; + if (shorthand == "flzma2") + return 609; if (shorthand == "none") return 0; abort();