histogram/doc/benchmarks.qbk
hans.dembinski@gmail.com 782a6740b7 improving docs
2017-02-12 23:23:03 +00:00

59 lines
2.1 KiB
Plaintext

[section:benchmarks Benchmarks]
The library is designed to be fast. While it is unlikely that the time spend in the histogram is limiting an application, we cannot predict how the library is used.
The following table shows results of a simple benchmark against
* `TH1I`, `TH3I` and `THnI` of the [@https://root.cern.ch ROOT framework]
* `histogram` and `histogramdd` from the Python module `numpy`
The benchmark against ROOT is implemented in C++, the benchmark against numpy in Python.
[table:benchmark_res Test system: Intel Core i7-4500U CPU clocked at 1.8 GHz, 8 GB of DDR3 RAM
[[distribution] [uniform] [normal]]
[[
[table distribution
[[dimension]]
[[No. of fills ]]
[[C++: ROOT \[t/s\]]]
[[C++: boost \[t/s\]]]
[[Py: numpy \[t/s\] ]]
[[Py: boost \[t/s\] ]]
]
]
[[table uniform
[[1D ] [3D ] [6D ]]
[[12M ] [4M ] [2M ]]
[[0.127] [0.199] [0.185]]
[[0.172] [0.177] [0.155]]
[[0.825] [0.727] [0.436]]
[[0.209] [0.229] [0.192]]
]]
[[table normal
[[1D ] [3D ] [6D ]]
[[12M ] [4M ] [2M ]]
[[0.168] [0.143] [0.179]]
[[0.172] [0.171] [0.150]]
[[0.824] [0.426] [0.401]]
[[0.207] [0.194] [0.168]]
]]]
]
Remarks:
* The comparison with ROOT puts ROOT at the advantage, since `TH1I` and `TH3I` are specialized classes for 1 dimension and 3 dimensions, not a general class for N dimensions. ROOT histograms also lack a comparably flexible system to define different binning schemes for each axis.
* Large vectors are pre-allocated and with random numbers drawn from a uniform or normal distribution for all tests. In the timed part, these numbers are read from the vector and put into the histograms. This reduces the overhead merely to memory access.
* The test with uniform random numbers never fills the overflow and underflow bins, while the test with random numbers from a normal distribution does. This explains some of the differences between the two distributions.
* All tests are repeated 10 times, the minimum is shown.
TODO
[endsect]