Skip to content

Commit 42519e8

Browse files
committed
Change files and number of iterations to save time
1 parent db3affc commit 42519e8

File tree

4 files changed

+72
-44
lines changed

4 files changed

+72
-44
lines changed

root/io/io/CMakeLists.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,21 @@ if(rootbench-datafiles)
1515
LIBRARIES Core RIO
1616
DOWNLOAD_DATAFILES Event0-sample.root)
1717

18-
# FIXME: too long benchmarks, needs to be optimised
19-
#RB_ADD_GBENCHMARK(CompressionBenchmarks_LHCb
20-
# TFile_LHCb_Benchmarks.cxx
21-
# LABEL short
22-
# LIBRARIES Core RIO
23-
# DOWNLOAD_DATAFILES lhcb_B2ppKK2011_md_noPIDstrip.root)
18+
RB_ADD_GBENCHMARK(CompressionBenchmarks_LHCb
19+
TFile_LHCb_Benchmarks.cxx
20+
LABEL short
21+
LIBRARIES Core RIO
22+
DOWNLOAD_DATAFILES lhcb_B2ppKK2011_md_noPIDstrip.root)
2423

25-
#RB_ADD_GBENCHMARK(CompressionBenchmarks_NanoAOD
26-
# TFile_NanoAOD_Benchmarks.cxx
27-
# LABEL short
28-
# LIBRARIES Core RIO
29-
# DOWNLOAD_DATAFILES Run2012B_DoubleMuParked.root)
24+
RB_ADD_GBENCHMARK(CompressionBenchmarks_NanoAOD
25+
TFile_NanoAOD_Benchmarks.cxx
26+
LABEL short
27+
LIBRARIES Core RIO
28+
DOWNLOAD_DATAFILES Run2012B_DoubleElectron.root)
3029

31-
#RB_ADD_GBENCHMARK(CompressionBenchmarks_ATLAS
32-
# TFile_ATLAS_Benchmarks.cxx
33-
# LABEL short
34-
# LIBRARIES Core RIO
35-
# DOWNLOAD_DATAFILES gg_data-zstd.root)
36-
endif()
30+
RB_ADD_GBENCHMARK(CompressionBenchmarks_ATLAS
31+
TFile_ATLAS_Benchmarks.cxx
32+
LABEL short
33+
LIBRARIES Core RIO
34+
DOWNLOAD_DATAFILES atlasopendata_mc_117050.ttbar_lep.root atlasopendata_DataMuons.root)
35+
endif()

root/io/io/TFile_ATLAS_Benchmarks.cxx

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ static std::string GetAlgoName(int algo) {
2121
return "error";
2222
}
2323

24-
static void BM_ATLAS_Decompress(benchmark::State &state, int algo) {
24+
static void BM_ATLAS_Decompress(benchmark::State &state, int algo, std::string filename) {
2525

2626
int comp_level = state.range(0);
2727
std::string comp_setting = std::to_string(algo * 100 + comp_level);
28-
std::string old_filename = (RB::GetDataDir() + "/gg_data-zstd.root").c_str();
28+
std::string old_filename = (RB::GetDataDir() + "/" + filename + ".root").c_str();
2929
std::string new_filename = "level_" + std::to_string(comp_level) + "_atlas_" + GetAlgoName(algo) + ".root";
3030

3131
gSystem->Exec(("hadd -v 0 -f" + comp_setting + " " + new_filename + " " + old_filename).c_str());
@@ -56,35 +56,64 @@ static void BM_ATLAS_Decompress(benchmark::State &state, int algo) {
5656
}
5757

5858

59-
static void BM_ATLAS_Decompress_ZLIB(benchmark::State &state) {
60-
BM_ATLAS_Decompress(state, 1);
59+
static void BM_ATLAS_Decompress_Real_ZLIB(benchmark::State &state) {
60+
BM_ATLAS_Decompress(state, 1, "atlasopendata_DataMuons");
6161
}
62-
static void BM_ATLAS_Decompress_LZMA(benchmark::State &state) {
63-
BM_ATLAS_Decompress(state, 2);
62+
static void BM_ATLAS_Decompress_Real_LZMA(benchmark::State &state) {
63+
BM_ATLAS_Decompress(state, 2, "atlasopendata_DataMuons");
6464
}
65-
static void BM_ATLAS_Decompress_LZ4(benchmark::State &state) {
66-
BM_ATLAS_Decompress(state, 4);
65+
static void BM_ATLAS_Decompress_Real_LZ4(benchmark::State &state) {
66+
BM_ATLAS_Decompress(state, 4, "atlasopendata_DataMuons");
6767
}
68-
static void BM_ATLAS_Decompress_ZSTD(benchmark::State &state) {
69-
BM_ATLAS_Decompress(state, 5);
68+
static void BM_ATLAS_Decompress_Real_ZSTD(benchmark::State &state) {
69+
BM_ATLAS_Decompress(state, 5, "atlasopendata_DataMuons");
7070
}
7171

72+
BENCHMARK(BM_ATLAS_Decompress_Real_ZLIB)
73+
->Arg(1)->Arg(6)->Arg(9)
74+
->Unit(benchmark::kMillisecond)->Iterations(3);
75+
76+
BENCHMARK(BM_ATLAS_Decompress_Real_LZMA)
77+
->Arg(1)->Arg(6)->Arg(9)
78+
->Unit(benchmark::kMillisecond)->Iterations(3);
79+
80+
BENCHMARK(BM_ATLAS_Decompress_Real_LZ4)
81+
->Arg(1)->Arg(6)->Arg(9)
82+
->Unit(benchmark::kMillisecond)->Iterations(3);
83+
84+
BENCHMARK(BM_ATLAS_Decompress_Real_ZSTD)
85+
->Arg(1)->Arg(6)->Arg(9)
86+
->Unit(benchmark::kMillisecond)->Iterations(3);
87+
88+
89+
static void BM_ATLAS_Decompress_MC_ZLIB(benchmark::State &state) {
90+
BM_ATLAS_Decompress(state, 1, "atlasopendata_mc_117050.ttbar_lep");
91+
}
92+
static void BM_ATLAS_Decompress_MC_LZMA(benchmark::State &state) {
93+
BM_ATLAS_Decompress(state, 2, "atlasopendata_mc_117050.ttbar_lep");
94+
}
95+
static void BM_ATLAS_Decompress_MC_LZ4(benchmark::State &state) {
96+
BM_ATLAS_Decompress(state, 4, "atlasopendata_mc_117050.ttbar_lep");
97+
}
98+
static void BM_ATLAS_Decompress_MC_ZSTD(benchmark::State &state) {
99+
BM_ATLAS_Decompress(state, 5, "atlasopendata_mc_117050.ttbar_lep");
100+
}
72101

73-
BENCHMARK(BM_ATLAS_Decompress_ZLIB)
102+
BENCHMARK(BM_ATLAS_Decompress_MC_ZLIB)
74103
->Arg(1)->Arg(6)->Arg(9)
75-
->Unit(benchmark::kMillisecond)->Iterations(5);
104+
->Unit(benchmark::kMillisecond)->Iterations(3);
76105

77-
BENCHMARK(BM_ATLAS_Decompress_LZMA)
106+
BENCHMARK(BM_ATLAS_Decompress_MC_LZMA)
78107
->Arg(1)->Arg(6)->Arg(9)
79-
->Unit(benchmark::kMillisecond)->Iterations(5);
108+
->Unit(benchmark::kMillisecond)->Iterations(3);
80109

81-
BENCHMARK(BM_ATLAS_Decompress_LZ4)
110+
BENCHMARK(BM_ATLAS_Decompress_MC_LZ4)
82111
->Arg(1)->Arg(6)->Arg(9)
83-
->Unit(benchmark::kMillisecond)->Iterations(5);
112+
->Unit(benchmark::kMillisecond)->Iterations(3);
84113

85-
BENCHMARK(BM_ATLAS_Decompress_ZSTD)
114+
BENCHMARK(BM_ATLAS_Decompress_MC_ZSTD)
86115
->Arg(1)->Arg(6)->Arg(9)
87-
->Unit(benchmark::kMillisecond)->Iterations(5);
116+
->Unit(benchmark::kMillisecond)->Iterations(3);
88117

89118

90119
BENCHMARK_MAIN();

root/io/io/TFile_LHCb_Benchmarks.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ static void BM_LHCb_Decompress_ZSTD(benchmark::State &state) {
8484

8585
BENCHMARK(BM_LHCb_Decompress_ZLIB)
8686
->Arg(1)->Arg(6)->Arg(9)
87-
->Unit(benchmark::kMillisecond)->Iterations(5);
87+
->Unit(benchmark::kMillisecond)->Iterations(3);
8888

8989
BENCHMARK(BM_LHCb_Decompress_LZMA)
9090
->Arg(1)->Arg(6)->Arg(9)
91-
->Unit(benchmark::kMillisecond)->Iterations(5);
91+
->Unit(benchmark::kMillisecond)->Iterations(3);
9292

9393
BENCHMARK(BM_LHCb_Decompress_LZ4)
9494
->Arg(1)->Arg(6)->Arg(9)
95-
->Unit(benchmark::kMillisecond)->Iterations(5);
95+
->Unit(benchmark::kMillisecond)->Iterations(3);
9696

9797
BENCHMARK(BM_LHCb_Decompress_ZSTD)
9898
->Arg(1)->Arg(6)->Arg(9)
99-
->Unit(benchmark::kMillisecond)->Iterations(5);
99+
->Unit(benchmark::kMillisecond)->Iterations(3);
100100

101101

102102
BENCHMARK_MAIN();

root/io/io/TFile_NanoAOD_Benchmarks.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static void BM_NanoAOD_Decompress(benchmark::State &state, int algo) {
2525

2626
int comp_level = state.range(0);
2727
std::string comp_setting = std::to_string(algo * 100 + comp_level);
28-
std::string old_filename = (RB::GetDataDir() + "/Run2012B_DoubleMuParked.root").c_str();
28+
std::string old_filename = (RB::GetDataDir() + "/Run2012B_DoubleElectron.root").c_str();
2929
std::string new_filename = "level_" + std::to_string(comp_level) + "_nanoaod_" + GetAlgoName(algo) + ".root";
3030

3131
gSystem->Exec(("hadd -v 0 -f" + comp_setting + " " + new_filename + " " + old_filename).c_str());
@@ -72,19 +72,19 @@ static void BM_NanoAOD_Decompress_ZSTD(benchmark::State &state) {
7272

7373
BENCHMARK(BM_NanoAOD_Decompress_ZLIB)
7474
->Arg(1)->Arg(6)->Arg(9)
75-
->Unit(benchmark::kMillisecond)->Iterations(5);
75+
->Unit(benchmark::kMillisecond)->Iterations(3);
7676

7777
BENCHMARK(BM_NanoAOD_Decompress_LZMA)
7878
->Arg(1)->Arg(6)->Arg(9)
79-
->Unit(benchmark::kMillisecond)->Iterations(5);
79+
->Unit(benchmark::kMillisecond)->Iterations(3);
8080

8181
BENCHMARK(BM_NanoAOD_Decompress_LZ4)
8282
->Arg(1)->Arg(6)->Arg(9)
83-
->Unit(benchmark::kMillisecond)->Iterations(5);
83+
->Unit(benchmark::kMillisecond)->Iterations(3);
8484

8585
BENCHMARK(BM_NanoAOD_Decompress_ZSTD)
8686
->Arg(1)->Arg(6)->Arg(9)
87-
->Unit(benchmark::kMillisecond)->Iterations(5);
87+
->Unit(benchmark::kMillisecond)->Iterations(3);
8888

8989

9090
BENCHMARK_MAIN();

0 commit comments

Comments
 (0)