ShellPkg : Cache the environment variable into memory to enhance
the performance. Currently UEFI Shell reads variable storage to get the environment variables every time running a new command. And reading(writing) UEFI variables is a high cost operation on most platforms. In order to enhance the performance this patch read the variable storage once and cache the environment variables in memory. Every further 'set' command will save the variable not only to Shell cache, but also the flash variable storage. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by:Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
@ -445,6 +445,8 @@ UefiMain (
|
||||
Status = CommandInit();
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
Status = ShellInitEnvVarList ();
|
||||
|
||||
//
|
||||
// Check the command line
|
||||
//
|
||||
@ -702,6 +704,8 @@ FreeResources:
|
||||
DEBUG_CODE(ShellInfoObject.ConsoleInfo = NULL;);
|
||||
}
|
||||
|
||||
ShellFreeEnvVarList ();
|
||||
|
||||
if (ShellCommandGetExit()) {
|
||||
return ((EFI_STATUS)ShellCommandGetExitCode());
|
||||
}
|
||||
|
Reference in New Issue
Block a user