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:
Qiu Shumin
2016-04-01 09:02:20 +08:00
parent 7a5f1426c5
commit b62bb8854f
4 changed files with 322 additions and 45 deletions

View File

@ -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());
}