From d37785cc9b8868273421caf30b03b74e4117bb21 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 27 Jan 2026 10:55:59 -0600 Subject: [PATCH] scripts: test/bench.py: Sped up simple suite/case filters By "simple" I mean any non-globbing suite/case ids. Non-globbing suite/case ids can be filtered early in the test_runner. But globbing ids require, surprise, globbing, which is currently handled by test/bench.py. --- This greatly speeds up valgrind testing of specific suites/cases, otherwise things get bogged down during the initial --list-cases due to the sheer number of test permutations we've accumulated. Maybe we shouldn't be running the initial --list-cases under Valgrind, but oh well. This mostly solves the problem without too many changes. --- scripts/bench.py | 7 ++++++- scripts/test.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/bench.py b/scripts/bench.py index 61a0c8f5..5fdf9d0d 100755 --- a/scripts/bench.py +++ b/scripts/bench.py @@ -945,7 +945,12 @@ def find_ids(runner, bench_ids=[], **args): expected_suite_perms, expected_case_perms, _, - _) = find_perms(runner, **args) + _) = find_perms( + runner, + # the runner can filter faster than we can, but not if + # we have any globs + bench_ids if not any('*' in id for id in bench_ids) else [], + **args) # no ids => all ids, before we evaluate globs if not bench_ids and args.get('by_cases'): diff --git a/scripts/test.py b/scripts/test.py index 0db2993d..ae570030 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -965,7 +965,12 @@ def find_ids(runner, test_ids=[], **args): expected_suite_perms, expected_case_perms, _, - _) = find_perms(runner, **args) + _) = find_perms( + runner, + # the runner can filter faster than we can, but not if + # we have any globs + test_ids if not any('*' in id for id in test_ids) else [], + **args) # no ids => all ids, before we evaluate globs if not test_ids and args.get('by_cases'):