Skip to content

Commit 16a6f62

Browse files
authored
Merge pull request #1470 from JuroOravec/patch-2
docs: document pitfalls of changing `benchmark_name` benchmark attribute
2 parents 2b7ab92 + 227e321 commit 16a6f62

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/source/benchmarks.rst

+13
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ benchmark types:
6060
- ``benchmark_name``: If given, used as benchmark function name instead of generated one
6161
``<module>.<class>.<function>``.
6262

63+
Not just any string can be ``benchmark_name`` - ``asv`` still expects the name
64+
to be dotted with at least two parts - ``<module>`` and ``<function>`` (e.g.
65+
``"my_file.time_something"``).
66+
67+
- First dotted part, the ``<module>``, is used as a group name. It can be any string,
68+
so even string like ``"My Group.time_something"`` is valid.
69+
70+
- The last dotted part, the ``<function>``, is used for determining whether a function
71+
is ``time_``, ``time_raw_``, ``mem_``, etc. As such, the function name MUST start with
72+
one of the prefixes (e.g. ``"my_file.time_something"``). Otherwise, the function will be ignored!
73+
74+
- The benchmark name MUST NOT contain a dash (``-``) in any of its parts.
75+
6376
- ``pretty_name``: If given, used to display the benchmark name instead of the
6477
benchmark function name.
6578

0 commit comments

Comments
 (0)