29long createNew(
int count)
32 for (
int i = 0; i < count; ++i) {
39long fillNew(
int count)
42 for (
int i = 0; i < count; ++i)
43 hist.
Fill({0.611, 0.611});
44 return hist.GetNDim();
50 std::vector<Experimental::Hist::RCoordArray<2>>
v(count);
51 for (
int i = 0; i < count; ++i)
52 v[i] = {0.611, 0.611};
54 return hist.GetNDim();
57long fillBufferedNew(
int count)
61 for (
int i = 0; i < count; ++i)
62 filler.Fill({0.611, 0.611});
63 return hist.GetNDim();
66using timefunc_t = std::add_pointer_t<long(
int)>;
68void time1(timefunc_t run,
int count,
const std::string &
name)
70 using namespace std::chrono;
71 auto start = high_resolution_clock::now();
73 auto end = high_resolution_clock::now();
74 duration<double> time_span = duration_cast<duration<double>>(
end -
start);
76 std::cout << count <<
" * " <<
name <<
": " << time_span.count() <<
"seconds \n";
79void time(timefunc_t r7,
int count,
const std::string &
name)
81 time1(r7, count,
name +
" (ROOT7)");
86 time(createNew, 1000000,
"create 2D hists");
87 time(fillNew, 100000000,
"2D fills");
88 time(fillBufferedNew, 100000000,
"2D fills (buffered)");
Histogram class for histograms with DIMENSIONS dimensions, where each bin count is stored by a value ...
void Fill(const CoordArray_t &x, Weight_t weight=(Weight_t) 1) noexcept
Add weight to the bin containing coordinate x.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.