From b3497bad1221704a5dbc5da0b10f42625f1ad2ed Mon Sep 17 00:00:00 2001 From: "Zhao, ZhiqiangX" Date: Fri, 23 Nov 2018 15:04:45 +0800 Subject: BaseTools: AutoGen and GenFds share the parser data. V2: Extract the common part of new API and the original main() function into one function. V1: https://bugzilla.tianocore.org/show_bug.cgi?id=1288 Currently, AutoGen and GenFds run in different python interpreters. The parser are duplicated. This patch is going to create new API for GenFds and have the build to call that API instead of executing GenFds.py. As such, the GenFds and build can share the parser data. This patch is expected to save the time of GenFds about 2~3 seconds. More details will be logged in BZ. This is the summary measure data generated from python cProfile for building Ovmf. Currently: 8379147 function calls (8135450 primitive calls) in 12.580 seconds After applying this patch: 3428712 function calls (3418881 primitive calls) in 8.944 seconds Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Carsey Jaben Cc: Bob Feng Reviewed-by: Bob Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py') diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 25417c4470..12e53010a5 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -935,6 +935,10 @@ class WorkspaceAutoGen(AutoGen): def GenFdsCommand(self): return (GenMake.TopLevelMakefile(self)._TEMPLATE_.Replace(GenMake.TopLevelMakefile(self)._TemplateDict)).strip() + @property + def GenFdsCommandDict(self): + return GenMake.TopLevelMakefile(self)._TemplateDict + ## Create makefile for the platform and modules in it # # @param CreateDepsMakeFile Flag indicating if the makefile for -- cgit v1.2.3