From 62851d46c3eb80546d2fbb64a86f39d85d37b320 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sat, 15 Sep 2018 21:13:21 -0400 Subject: Added a message to readme about page faulting --- benchmarks/README.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'benchmarks') 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, -- cgit v1.2.1