summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2020-04-25 11:44:09 -0700
committerRoss Barnowski <rossbar@berkeley.edu>2020-04-25 13:19:22 -0700
commitb751304ec2d1781256d53e1c2faa0908b398240d (patch)
tree31997c016cea3b26673ee12c1c69bd3a3a84e01e /doc
parent619422b493eaf88c42373af1725ac0aa2297fa91 (diff)
downloadnumpy-b751304ec2d1781256d53e1c2faa0908b398240d.tar.gz
DOC,BLD: Limit timeit iterations in random docs.
Limiting the number of loops performed in the %timeit evaluation results in a ~20% speedup in the time it takes to build the documentation. The results of the "benchmarking" are less accurate from the limited number of evaluations, but the relationship between the timing between the legacy and Generator sampling methods is preserved.
Diffstat (limited to 'doc')
-rw-r--r--doc/source/reference/random/new-or-different.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/source/reference/random/new-or-different.rst b/doc/source/reference/random/new-or-different.rst
index b3bddb443..ed55c71bf 100644
--- a/doc/source/reference/random/new-or-different.rst
+++ b/doc/source/reference/random/new-or-different.rst
@@ -69,18 +69,18 @@ And in more detail:
from numpy.random import Generator, PCG64
import numpy.random
rg = Generator(PCG64())
- %timeit rg.standard_normal(100000)
- %timeit numpy.random.standard_normal(100000)
+ %timeit -n 1 rg.standard_normal(100000)
+ %timeit -n 1 numpy.random.standard_normal(100000)
.. ipython:: python
- %timeit rg.standard_exponential(100000)
- %timeit numpy.random.standard_exponential(100000)
+ %timeit -n 1 rg.standard_exponential(100000)
+ %timeit -n 1 numpy.random.standard_exponential(100000)
.. ipython:: python
- %timeit rg.standard_gamma(3.0, 100000)
- %timeit numpy.random.standard_gamma(3.0, 100000)
+ %timeit -n 1 rg.standard_gamma(3.0, 100000)
+ %timeit -n 1 numpy.random.standard_gamma(3.0, 100000)
* Optional ``dtype`` argument that accepts ``np.float32`` or ``np.float64``
to produce either single or double prevision uniform random variables for