]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTool: Add cache for the result of SkipAutogen.
authorFeng, Bob C <bob.c.feng@intel.com>
Mon, 2 Jul 2018 01:15:47 +0000 (09:15 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 9 Jul 2018 02:28:08 +0000 (10:28 +0800)
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>
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/Common/GlobalData.py

index b0801c787acc97f80076846fcd768781372ceb92..d100648606f7cbea022007373c4cabbf52e0d737 100644 (file)
@@ -4309,11 +4309,14 @@ class ModuleAutoGen(AutoGen):
     def CanSkipbyHash(self):\r
         if GlobalData.gUseHashCache:\r
             return not self.GenModuleHash()\r
     def CanSkipbyHash(self):\r
         if GlobalData.gUseHashCache:\r
             return not self.GenModuleHash()\r
+        return False\r
 \r
     ## Decide whether we can skip the ModuleAutoGen process\r
     #  If any source file is newer than the module than we cannot skip\r
     #\r
     def CanSkip(self):\r
 \r
     ## Decide whether we can skip the ModuleAutoGen process\r
     #  If any source file is newer than the module than we cannot skip\r
     #\r
     def CanSkip(self):\r
+        if self.MetaFile in GlobalData.gSikpAutoGenCache:\r
+            return True\r
         if not os.path.exists(self.GetTimeStampPath()):\r
             return False\r
         #last creation time of the module\r
         if not os.path.exists(self.GetTimeStampPath()):\r
             return False\r
         #last creation time of the module\r
@@ -4332,6 +4335,7 @@ class ModuleAutoGen(AutoGen):
                     ModuleAutoGen.TimeDict[source] = os.stat(source)[8]\r
                 if ModuleAutoGen.TimeDict[source] > DstTimeStamp:\r
                     return False\r
                     ModuleAutoGen.TimeDict[source] = os.stat(source)[8]\r
                 if ModuleAutoGen.TimeDict[source] > DstTimeStamp:\r
                     return False\r
+        GlobalData.gSikpAutoGenCache.add(self.MetaFile)\r
         return True\r
 \r
     def GetTimeStampPath(self):\r
         return True\r
 \r
     def GetTimeStampPath(self):\r
index afb3d8f0208b9200fb0d64c0099a6cc89b48e99f..fac7cde708f6d63e7ffec3c8d7d075489b486969 100644 (file)
@@ -113,3 +113,4 @@ gPlatformHash = None
 gPackageHash = {}\r
 gModuleHash = {}\r
 gEnableGenfdsMultiThread = False\r
 gPackageHash = {}\r
 gModuleHash = {}\r
 gEnableGenfdsMultiThread = False\r
+gSikpAutoGenCache = set()\r