diff options
Diffstat (limited to 'benchmarks/README.rst')
-rw-r--r-- | benchmarks/README.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/benchmarks/README.rst b/benchmarks/README.rst index f4f0b0de9..b67994ce0 100644 --- a/benchmarks/README.rst +++ b/benchmarks/README.rst @@ -60,3 +60,11 @@ Some things to consider: - Preparing arrays etc. should generally be put in the ``setup`` method rather than the ``time_`` methods, to avoid counting preparation time together with the time of the benchmarked operation. + +- Be mindful that large arrays created with ``np.empty`` or ``np.zeros`` might + not be allocated in physical memory until the memory is accessed. If this is + desired behaviour, make sure to comment it in your setup function. If + you are benchmarking an algorithm, it is unlikely that a user will be + executing said algorithm on a newly created empty/zero array. One can force + pagefaults to occur in the setup phase either by calling ``np.ones`` or + ``arr.fill(value)`` after creating the array, |