Skip to content

Commit 376a59e

Browse files
committed
DOC: Add developer documentation for benchmarking
This commit adds a new file in the developer documentation for how to run NumPy-Financial's benchmark suite.
1 parent b7a4dd9 commit 376a59e

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Running the benchmarks
2+
3+
This document outlines how to setup and run the benchmarks using [asv](https://asv.readthedocs.io/en/v0.6.1/).
4+
5+
## Installing asv
6+
7+
`asv` can be installed with poetry via the `bench` group to install the bench group run:
8+
9+
```shell
10+
poetry install --with=bench
11+
```
12+
13+
This will install ``asv`` into your poetry environment.
14+
15+
## Running the benchmarks
16+
17+
To run the benchmarks with ``asv``, simply enter:
18+
19+
```shell
20+
poetry run asv run
21+
```
22+
23+
## Viewing the results
24+
25+
There are two steps to viewing the results locally. The results need to be published and the launched in a local web browser.
26+
27+
To publish the results use:
28+
29+
```shell
30+
poetry run asv publish
31+
```
32+
33+
And then to view the results:
34+
35+
```shell
36+
poetry run asv preview
37+
```
38+
39+
This will launch a local web browser from which you can view the results
40+
41+
## Dry runs
42+
43+
One common use case is to use ``asv`` in development, there are several useful flags that should be used:
44+
45+
```shell
46+
poetry run asv --python=same --quick --dry-run
47+
```
48+
49+
We are adding three flags, these flags are:
50+
51+
1. `--python=same` uses the same environment as your development environment (saves time to avoid building environments)
52+
2. `--quick` only runs the benchmarks once
53+
3. `--dry-run` to not save the results of the benchmarks
54+
55+
These can be useful for getting quick feedback during development, but should not be used as anything other than a rough guide.

0 commit comments

Comments
 (0)