From fe81f2525f988d161075fe64ce9285b190c0c9f4 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Mon, 10 Jul 2023 00:14:01 +0000 Subject: [PATCH 1/2] DOC: Detail skipping parameters --- docs/source/writing_benchmarks.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/source/writing_benchmarks.rst b/docs/source/writing_benchmarks.rst index c5e251a74..59396f4a7 100644 --- a/docs/source/writing_benchmarks.rst +++ b/docs/source/writing_benchmarks.rst @@ -255,6 +255,29 @@ names such as "param1", "param2". Note that ``setup_cache`` is not parameterized. +.. _skipping-benchmarks: + +Skipping benchmarks +------------------------ + +.. note:: + + This section is only applicable from version 0.0.6 on-wards + +Conversely, it is possible (typically due to high setup times) that one might +want to skip some benchmarks all-together, or just for some sets of parameters. +This is accomplished by an attribute ``skip_params``, which can be used with the +decorator ``@skip_for_params`` as:: + + + @skip_for_params([(10, 'arange'), (1000, 'range')]) + def time_ranges(n, func_name): + f = {'range': range, 'arange': np.arange}[func_name] + for i in f(n): + pass + +This skips running benchmarks for these and also the setup functions. However, +``setup_cache`` is not affected. Benchmark types --------------- From 34f6e221284b0e483859458c48ed45f82b561b46 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Tue, 11 Jul 2023 08:35:45 +0300 Subject: [PATCH 2/2] typo Co-authored-by: Akihiro Nitta --- docs/source/writing_benchmarks.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/writing_benchmarks.rst b/docs/source/writing_benchmarks.rst index 59396f4a7..a6949e515 100644 --- a/docs/source/writing_benchmarks.rst +++ b/docs/source/writing_benchmarks.rst @@ -262,7 +262,7 @@ Skipping benchmarks .. note:: - This section is only applicable from version 0.0.6 on-wards + This section is only applicable from version 0.6.0 on-wards Conversely, it is possible (typically due to high setup times) that one might want to skip some benchmarks all-together, or just for some sets of parameters.