summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-07-11 10:03:28 +0200
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-16 09:13:39 +0000
commit027750df1733b34fc8aabce8f3c7dbfca4fc8ec8 (patch)
tree323ef191e5df65715e8e22126ffed682dec9cc87
parentd8c4420fb6c4bc0907aff1987a70c4d999cd6ded (diff)
downloadbuildstream-027750df1733b34fc8aabce8f3c7dbfca4fc8ec8.tar.gz
element.py: Call __update_strict_cache_key_of_rdeps() only if needed
It's not required with strict build plans. Skip it to improve performance.
-rw-r--r--src/buildstream/element.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 9dbb808a3..c02562ee6 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -3030,15 +3030,15 @@ class Element(Plugin):
self.__strict_cache_key = self._calculate_cache_key(dependencies)
if self.__strict_cache_key is not None:
- self.__update_strict_cache_key_of_rdeps()
+ # In strict mode, the strong cache key always matches the strict cache key
+ if context.get_strict():
+ self.__cache_key = self.__strict_cache_key
- # In strict mode, the strong cache key always matches the strict cache key
- if context.get_strict():
- self.__cache_key = self.__strict_cache_key
-
- # The Element may have just become ready for runtime now that the
- # strong cache key has just been set
- self.__update_ready_for_runtime()
+ # The Element may have just become ready for runtime now that the
+ # strong cache key has just been set
+ self.__update_ready_for_runtime()
+ else:
+ self.__update_strict_cache_key_of_rdeps()
if self.__strict_cache_key is not None and self.__can_query_cache_callback is not None:
self.__can_query_cache_callback(self)