From ec23abfe1f77b756ea63f4fc0a572c4d9cd8c30b Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Fri, 13 Oct 2023 11:23:27 +1300 Subject: [PATCH] =?UTF-8?q?buildtools:=20Don=E2=80=99t=20call=20normpath()?= =?UTF-8?q?=20repeatedly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A non‐negligible fraction of the build process — especially for incremental builds — is spent calling normpath() over and over again. Make builds faster by not doing that. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- buildtools/wafsamba/samba_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 39512f0ac96..b22b7a8879b 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -710,8 +710,9 @@ def samba_before_apply_obj_vars(self): """before apply_obj_vars for uselib, this removes the standard paths""" def is_standard_libpath(env, path): + normalized_path = os.path.normpath(path) for _path in env.STANDARD_LIBPATH: - if _path == os.path.normpath(path): + if _path == normalized_path: return True return False