Benchmark comparing row-wise and column-wise storage performance
The test consists in writing/reading to/from keys or trees To execute the benchmark:
for example for N=10000, the following output is produced on an 2.7 GHz Intel Core i7 (year 2011). The names featuring a "t" are relative to trees, the faster, the better.
******************************************************************
******************************************************************
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t bytes
{
TH1F h(
"h",
"h", 1000, -3, 3);
h.FillRandom(
"gaus", 50000);
for (
Int_t i = 0; i <
N; i++) {
}
printf(
"billw%d : RT=%7.3f s, Cpu=%7.3f s, File size= %9d bytes, CX= %g\n",
f.GetCompressionFactor());
}
{
TIter next(
f.GetListOfKeys());
auto hmean =
new TH1F(
"hmean",
"hist mean from keys", 100, 0, 1);
while ((key = (
TKey*)next())) {
i++;
}
}
{
auto h =
new TH1F(
"h",
"h", 1000, -3, 3);
h->FillRandom(
"gaus", 50000);
auto T =
new TTree(
"T",
"test bill");
T->Branch(
"event",
"TH1F", &
h, 64000, 0);
for (
Int_t i = 0; i <
N; i++) {
T->Fill();
}
T->Write();
delete T;
printf(
"billtw%d : RT=%7.3f s, Cpu=%7.3f s, File size= %9d bytes, CX= %g\n",
f.GetCompressionFactor());
}
{
auto hmeant =
new TH1F(
"hmeant",
"hist mean from tree", 100, 0, 1);
T->GetEntry(i);
}
}
{
}
printf(
"******************************************************************\n");
printf(
"******************************************************************\n");
}
R__EXTERN TRandom * gRandom
R__EXTERN TSystem * gSystem
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
1-D histogram with a float per channel (see TH1 documentation)
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual TObject * ReadObj()
To read a TObject* from the file.
Double_t Rndm() override
Machine independent random number generator.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual int Unlink(const char *name)
Unlink, i.e.
A TTree represents a columnar dataset.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
- Author
- Rene Brun
Definition in file tree202_benchmarks.C.