diff options
author | Mark Harfouche <mark.harfouche@gmail.com> | 2018-09-15 21:13:21 -0400 |
---|---|---|
committer | Mark Harfouche <mark.harfouche@gmail.com> | 2018-09-16 09:19:36 -0400 |
commit | 62851d46c3eb80546d2fbb64a86f39d85d37b320 (patch) | |
tree | 3293ad3cdc9f45a464227fc0d8776fe54a544bae /benchmarks | |
parent | 6ade16ee3f9cc0dd4f8486da6c247720f14c4e1e (diff) | |
download | numpy-62851d46c3eb80546d2fbb64a86f39d85d37b320.tar.gz |
Added a message to readme about page faulting
Diffstat (limited to 'benchmarks')
-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, |