aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-02 14:30:04 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2018-11-02 21:04:13 +0200
commit468d1a05ec0a020150e34fb2f0865e3971679c23 (patch)
tree84573621664afe2a126cb60d3275a45262b67e3a /mesonbuild
parent388108aa88b8fd44a450f71badd2c3ca5fda1bda (diff)
downloadmeson-468d1a05ec0a020150e34fb2f0865e3971679c23.zip
meson-468d1a05ec0a020150e34fb2f0865e3971679c23.tar.gz
meson-468d1a05ec0a020150e34fb2f0865e3971679c23.tar.bz2
meson: cache get_target_generated_dir
This reduces the build time about 2 sec. The result itself is not hard to calculate. However, persistent join calls with the same 2 strings are not that usefull. This also caused about 600'000 calls to get_target_dir, we are now down to 60'000 calls form this function to get_target_dir.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/backends.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 6a3d936..374b7fb 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -26,6 +26,7 @@ from ..mesonlib import File
from ..compilers import CompilerArgs
from collections import OrderedDict
import shlex
+from functools import lru_cache
class CleanTrees:
@@ -210,6 +211,7 @@ class Backend:
def get_target_private_dir_abs(self, target):
return os.path.join(self.environment.get_build_dir(), self.get_target_private_dir(target))
+ @lru_cache(maxsize=None)
def get_target_generated_dir(self, target, gensrc, src):
"""
Takes a BuildTarget, a generator source (CustomTarget or GeneratedList),