commit d26c688f0bcd03b7be2bfadc41cbb2693d9788d4
parent e96b05efb97b6fe259025952ba432ac2fa81a725
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Mon, 8 Dec 2025 20:43:19 +0000
Bug 2002884 - Cache calls to manifestparser.manifestparser.filters._match r=jcristau
This saves a large 1.7s during task graph computation.
Differential Revision: https://phabricator.services.mozilla.com/D274359
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/testing/mozbase/manifestparser/manifestparser/filters.py b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -8,6 +8,7 @@ dictionary of values, and returns a new iterable of test objects. It is
possible to define custom filters if the built-in ones are not enough.
"""
+import functools
import itertools
import os
from collections import defaultdict
@@ -20,6 +21,7 @@ from .util import normsep
# built-in filters
+@functools.lru_cache(maxsize=None) # noqa: UP033
def _match(exprs, strict, **values):
"""Return the first matching expression, or None if no match."""
for e in exprs.splitlines():