Skip to content

Commit f07adb3

Browse files
committed
Improve readme
1 parent aaf9384 commit f07adb3

1 file changed

Lines changed: 27 additions & 9 deletions

File tree

benchmarks/README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,39 @@ The `npbench/` suite uses kernels from [npbench](https://github.com/spcl/npbench
1414
| `npbench/bench_go_fast.py` | `tanh` | float64 | M (6k x 6k), L (20k x 20k) |
1515
| `npbench/bench_mandelbrot.py` | `abs`, `multiply`, `add` | complex128 | M (250/500), L (833/1000) |
1616

17-
## Threading
17+
## Running Benchmarks
1818

19-
Set `MKL_NUM_THREADS` in the environment before running ASV to control the thread count used by MKL:
19+
Prerequisites:
2020

2121
```bash
22-
MKL_NUM_THREADS=8 asv run --python=same --quick HEAD^!
22+
pip install asv psutil
2323
```
2424

25-
If `MKL_NUM_THREADS` is not set, `__init__.py` applies a default: **4** threads when the machine has 4 or more physical cores, or **1** (single-threaded) otherwise. This keeps results comparable across CI machines in the shared pool regardless of their total core count. Physical cores are detected via `psutil.cpu_count(logical=False)` (hyperthreads excluded per MKL recommendation).
25+
Run benchmarks against the current commit:
26+
27+
```bash
28+
asv run --python=same --quick HEAD^!
29+
```
30+
31+
Compare two commits:
32+
33+
```bash
34+
asv continuous --python=same HEAD~1 HEAD
35+
```
2636

27-
## Quick Start
37+
View results in a browser:
2838

2939
```bash
30-
cd benchmarks
31-
asv run --python=same --quick HEAD^! # time the current commit
32-
asv compare main HEAD # compare against main
33-
asv publish && asv preview # view HTML report locally
40+
asv publish
41+
asv preview
3442
```
43+
44+
## Threading
45+
46+
Set `MKL_NUM_THREADS` to control the thread count used by MKL:
47+
48+
```bash
49+
MKL_NUM_THREADS=8 asv run --python=same --quick HEAD^!
50+
```
51+
52+
If `MKL_NUM_THREADS` is not set, `__init__.py` applies a default: **4** threads when the machine has 4 or more physical cores, or **1** (single-threaded) otherwise. This keeps results comparable across CI machines in the shared pool regardless of their total core count. Physical cores are detected via `psutil.cpu_count(logical=False)` (hyperthreads excluded per MKL recommendation).

0 commit comments

Comments
 (0)