Browse code

add asv

Bas Nijholt authored on 14/11/2017 16:14:21
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+# adaptive benchmarks
2
+
3
+Benchmarking adaptive with Airspeed Velocity.
4
+
5
+## Usage
6
+
7
+Airspeed Velocity manages building and Python conda environments by itself,
8
+unless told otherwise. To run the benchmarks, you do not need to install a
9
+development version of adaptive to your current Python environment.
10
+
11
+Run ASV commands (record results and generate HTML):
12
+
13
+```bash
14
+cd benchmarks
15
+asv run --skip-existing-commits --steps 10 ALL
16
+asv publish
17
+asv preview
18
+```
19
+
20
+More on how to use ``asv`` can be found in `ASV documentation`_
21
+Command-line help is available as usual via ``asv --help`` and
22
+``asv run --help``.
23
+
24
+
25
+## Writing benchmarks
26
+
27
+See [`ASV documentation`](https://asv.readthedocs.io/) for basics on how to write benchmarks.
28
+
29
+Some things to consider:
30
+
31
+- The benchmark suite should be importable with any adaptive version.
32
+
33
+- The benchmark parameters etc. should not depend on which adaptive version
34
+  is installed.
35
+
36
+- Try to keep the runtime of the benchmark reasonable.
37
+
38
+- Prefer ASV's ``time_`` methods for benchmarking times rather than cooking up
39
+  time measurements via ``time.clock``, even if it requires some juggling when
40
+  writing the benchmark.
41
+
42
+- Preparing arrays etc. should generally be put in the ``setup`` method rather
43
+  than the ``time_`` methods, to avoid counting preparation time together with
44
+  the time of the benchmarked operation.