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
When you run that test, a profile will also be saved in the `tests/benchmarks/.profiles` folder, in a file named after the profiled function. Open the file in a browser to see the profile.
16
+
17
+
If you run a benchmark test multiple times (either on same code or different versions of the code), you probably want to save it.
18
+
19
+
Either pass in `--benchmark-autosave` to save to an auto-generated filename or pass in `--benchmark-save=YOURNAME` to save with your specified name in the filename. All benchmark files will always start with a counter, beginning with 0001.
20
+
21
+
Once saved, compare using the `pytest-benchmark` command and the counter numbers:
22
+
23
+
`pytest-benchmark compare 0004 0005`
24
+
25
+
You can sort the comparison using `--sort`, save it to a CSV using `--csv`, or save it to a histogram with `--histogram`.
26
+
More details available in the [pytest-benchmark reference](https://pytest-benchmark.readthedocs.io/en/latest/usage.html#comparison-cli).
0 commit comments