summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2019-03-01 20:26:21 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2019-03-03 02:21:12 (GMT)
commit9c6608bc1069d8bfd199e30801b2d1118c0137af (patch)
tree1e185a82af26601412c28da8c90b3fc8c9eb53c4 /src/engine
parent9bbb976181f4cd5b6261993bae9fb5535bf07587 (diff)
downloadSCons-9c6608bc1069d8bfd199e30801b2d1118c0137af.zip
SCons-9c6608bc1069d8bfd199e30801b2d1118c0137af.tar.gz
SCons-9c6608bc1069d8bfd199e30801b2d1118c0137af.tar.bz2
Added logic to shortcut comparing prev_ni if there is no dependency map from previous build. This should speed up md5-timestamp builds for clean builds. Also added debug logic to dump and check aagainst previous implementation at top of FS.PY MD5_TIMESTAMP_DEBUG flag. currently set to False
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Node/FS.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index f2ba7be..f520af1 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -61,6 +61,8 @@ from . import DeciderNeedsNode
print_duplicate = 0
+MD5_TIMESTAMP_DEBUG = False
+
def sconsign_none(node):
raise NotImplementedError
@@ -3335,9 +3337,16 @@ class File(Base):
List of csigs for provided list of children
"""
prev = []
+ # MD5_TIMESTAMP_DEBUG = False
+
+ if len(dmap) == 0:
+ if MD5_TIMESTAMP_DEBUG: print("Nothing dmap shortcutting")
+ return None
+ if MD5_TIMESTAMP_DEBUG: print("len(dmap):%d"%len(dmap))
# First try the simple name for node
c_str = str(self)
+ if MD5_TIMESTAMP_DEBUG: print("Checking :%s"%c_str)
df = dmap.get(c_str, None)
if df:
return df
@@ -3345,6 +3354,7 @@ class File(Base):
if os.altsep:
c_str = c_str.replace(os.sep, os.altsep)
df = dmap.get(c_str, None)
+ if MD5_TIMESTAMP_DEBUG: print("-->%s"%df)
if df:
return df
@@ -3353,12 +3363,14 @@ class File(Base):
# this should yield a path which matches what's in the sconsign
c_str = self.get_path()
df = dmap.get(c_str, None)
+ if MD5_TIMESTAMP_DEBUG: print("-->%s"%df)
if df:
return df
if os.altsep:
c_str = c_str.replace(os.sep, os.altsep)
df = dmap.get(c_str, None)
+ if MD5_TIMESTAMP_DEBUG: print("-->%s"%df)
if df:
return df
@@ -3400,13 +3412,21 @@ class File(Base):
dependency_map = self._build_dependency_map(bi)
rebuilt = True
+ if len(dependency_map) == 0:
+ # If there's no dependency map, there's no need to find the
+ # prev_ni as there aren't any
+ # shortcut the rest of the logic
+ if MD5_TIMESTAMP_DEBUG: print("Skipping checks len(dmap)=0")
+ return True
new_prev_ni = self._get_previous_signatures(dependency_map)
new = self.changed_timestamp_match(target, new_prev_ni)
- old = self.changed_timestamp_match(target, prev_ni)
- if old != new:
- print("Mismatch self.changed_timestamp_match(%s, prev_ni) old:%s new:%s"%(str(target), old, new))
- new_prev_ni = self._get_previous_signatures(dependency_map)
+ if MD5_TIMESTAMP_DEBUG:
+ old = self.changed_timestamp_match(target, prev_ni)
+
+ if old != new:
+ print("Mismatch self.changed_timestamp_match(%s, prev_ni) old:%s new:%s"%(str(target), old, new))
+ new_prev_ni = self._get_previous_signatures(dependency_map)
if not new: