diff options
author | Qiyu8 <fangchunlin@huawei.com> | 2020-03-02 15:11:49 +0800 |
---|---|---|
committer | Qiyu8 <fangchunlin@huawei.com> | 2020-03-02 15:11:49 +0800 |
commit | a7ff6a062d93dcc81386d3095a84a38c8b2283d3 (patch) | |
tree | d4c6399f59f10b9cf8c232a4b3bc3e5233013855 /benchmarks | |
parent | b8c7f390fa1ca51df6fb5bf02ed153dfbab47819 (diff) | |
download | numpy-a7ff6a062d93dcc81386d3095a84a38c8b2283d3.tar.gz |
improve benchmark doc formate
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/README.rst | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/benchmarks/README.rst b/benchmarks/README.rst index b1bdc00cb..007144586 100644 --- a/benchmarks/README.rst +++ b/benchmarks/README.rst @@ -16,32 +16,31 @@ unless told otherwise. Some of the benchmarking features in ``runtests.py``. To run the benchmarks, you do not need to install a development version of NumPy to your current Python environment. -*Before beginning, ensure that* [airspeed velocity](https://github.com/airspeed-velocity/asv) *is installed.* By default, `asv` ships with support for [anaconda](https://store.continuum.io/cshop/anaconda/) and [virtualenv](https://pypi.python.org/pypi/virtualenv). +*Before beginning, ensure that* airspeed velocity *is installed.* +By default, `asv` ships with support for anaconda and virtualenv. -``` -pip install asv -pip install virtualenv -``` + pip install asv + pip install virtualenv -After contributing new benchmarks, you should test them locally before submitting a pull request. +After contributing new benchmarks, you should test them locally +before submitting a pull request. -To run all benchmarks, navigate to the root NumPy directory at the command line and execute: +To run all benchmarks, navigate to the root NumPy directory at +the command line and execute: -``` -python runtests.py --bench -``` + python runtests.py --bench - where `--bench` activates the benchmark suite instead of the test suite. This builds NumPy and runs the benchmarks. - - To run benchmarks from a particular benchmark module, such as `bench_core.py`, simply append the filename without the extension:: +where ``--bench`` activates the benchmark suite instead of the +test suite. This builds NumPy and runs the benchmarks. +To run benchmarks from a particular benchmark module, such as +``bench_core.py``, simply append the filename without the extension:: python runtests.py --bench bench_core -To run a benchmark defined in a class, such as `Mandelbrot` from `bench_avx.py`:: +To run a benchmark defined in a class, such as ``Mandelbrot`` +from ``bench_avx.py``:: -``` -python runtests.py --bench bench_avx.Mandelbrot -``` + python runtests.py --bench bench_avx.Mandelbrot Compare change in benchmark results to another version/commit/branch:: @@ -49,14 +48,19 @@ Compare change in benchmark results to another version/commit/branch:: python runtests.py --bench-compare 8bf4e9b bench_core python runtests.py --bench-compare master bench_core - All of the commands above display the results in plain text in the console, and the results are not saved for comparison with future commits. For greater control, a graphical view, and to have results saved for future comparison you can run ASV commands (record results and generate HTML):: +All of the commands above display the results in plain text in +the console, and the results are not saved for comparison with +future commits. For greater control, a graphical view, and to +have results saved for future comparison you can run ASV commands +(record results and generate HTML):: cd benchmarks asv run --skip-existing-commits --steps 10 ALL asv publish asv preview - ASV will report that it is running a server. Using any browser, you can review the results by navigating to [http://127.0.0.1:8080](http://127.0.0.1:8080/) (local machine, port 8080). +ASV will report that it is running a server. Using any browser, +you can review the results by navigating to http://127.0.0.1:8080. More on how to use ``asv`` can be found in `ASV documentation`_ Command-line help is available as usual via ``asv --help`` and |