You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These benchmarks are intended as developer-facing. They contain checks to ensure that performance has not degraded.
4
+
5
+
## Extra requirements
6
+
7
+
You need to install [`pyvsc`](https://pyvsc.readthedocs.io/en/latest/introduction.html) in order to run the benchmarks. This is not included in `pyproject.toml` as a dependency to avoid making installation size bigger than necessary.
8
+
9
+
## Running
10
+
11
+
To run, from the root of constrainedrandom:
12
+
13
+
```
14
+
python3 -m benchmarks
15
+
```
16
+
17
+
## Defining new benchmarks
18
+
19
+
Benchmark test cases should inherit from `benchmarks.benchmark_utils.BenchmarkTestCase`.
20
+
21
+
Each test case should implement a `get_randobjs()` method. This returns a dictionary of the random objects to be tested. Each should implement the `randomize()` function and be equivalent.
22
+
23
+
Each test case should also implement a `check_perf()` method, so that the expected results are defined in an executable, checkable manner.
24
+
25
+
## Shared framework
26
+
27
+
The benchmarks use a shared testing framework with the unit tests. However, they are kept separate so that users don't have to install `pyvsc` to ensure basic functionality of constrainedrandom.
0 commit comments