aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-01 17:21:56 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2020-03-01 19:27:49 +0200
commit9e40a0125c3bd558fbd29da8715d334d787c1a4d (patch)
tree078210ca8199bb6e428f12b237b9db2db70d7ef7
parent4524088d386d2e2315d8fef6ffedc11d8e9a394a (diff)
downloadmeson-9e40a0125c3bd558fbd29da8715d334d787c1a4d.zip
meson-9e40a0125c3bd558fbd29da8715d334d787c1a4d.tar.gz
meson-9e40a0125c3bd558fbd29da8715d334d787c1a4d.tar.bz2
meson: cache the results of can_compile
the check for which files can be compiled are called again and again on the same files over and over again. Caching this here shaves off 11s of the build time of efl (which has grown in the last 3 versions to over 40 sec. again)
-rw-r--r--mesonbuild/compilers/compilers.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 2a29716..1c0adff 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -731,6 +731,7 @@ class Compiler:
return repr_str.format(self.__class__.__name__, self.version,
' '.join(self.exelist))
+ @lru_cache(maxsize=None)
def can_compile(self, src) -> bool:
if hasattr(src, 'fname'):
src = src.fname