summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2018-07-02 09:15:47 +0800
committerLiming Gao <liming.gao@intel.com>2018-07-09 10:28:08 +0800
commit18ef4e713f2fb5d2f84d179b9861b4afee212f65 (patch)
tree58b88ecd5d39407f1610e449b5c97340aca11c31 /BaseTools
parentf7496d717357b9af78414d19679b073403812340 (diff)
downloadedk2-18ef4e713f2fb5d2f84d179b9861b4afee212f65.zip
edk2-18ef4e713f2fb5d2f84d179b9861b4afee212f65.tar.gz
edk2-18ef4e713f2fb5d2f84d179b9861b4afee212f65.tar.bz2
BaseTool: Add cache for the result of SkipAutogen.
Add a cache for the value of skip ModuleAutoGen process flag. This cache can improve build performance. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py4
-rw-r--r--BaseTools/Source/Python/Common/GlobalData.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index b0801c7..d100648 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -4309,11 +4309,14 @@ class ModuleAutoGen(AutoGen):
def CanSkipbyHash(self):
if GlobalData.gUseHashCache:
return not self.GenModuleHash()
+ return False
## Decide whether we can skip the ModuleAutoGen process
# If any source file is newer than the module than we cannot skip
#
def CanSkip(self):
+ if self.MetaFile in GlobalData.gSikpAutoGenCache:
+ return True
if not os.path.exists(self.GetTimeStampPath()):
return False
#last creation time of the module
@@ -4332,6 +4335,7 @@ class ModuleAutoGen(AutoGen):
ModuleAutoGen.TimeDict[source] = os.stat(source)[8]
if ModuleAutoGen.TimeDict[source] > DstTimeStamp:
return False
+ GlobalData.gSikpAutoGenCache.add(self.MetaFile)
return True
def GetTimeStampPath(self):
diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py
index afb3d8f..fac7cde 100644
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ b/BaseTools/Source/Python/Common/GlobalData.py
@@ -113,3 +113,4 @@ gPlatformHash = None
gPackageHash = {}
gModuleHash = {}
gEnableGenfdsMultiThread = False
+gSikpAutoGenCache = set()