REF : https://bugzilla.tianocore.org/show_bug.cgi?id=4817
Before entering BIOS setup, CoreValidateHandle function executed over 600,000 times during BDS phase on latest 8S server platform. For current EFI handle database, InsertTailList function is used to insert each EFI handle into the handle database. The handle number on latest 8S server platform is over 2000 and the EFI handles which are inserted into handle database earlier will be used frequently. So using ForwardLink instead of Backlink to go through the handle database in CoreValidateHandle function will be faster. After verification on latest 8S server platform, changing Backlink to ForwardLink can save 14s+ BDS boot time. Cc: Ray Ni <ray...@intel.com> Cc: Star Zeng <star.z...@intel.com> Cc: Liming Gao <gaolim...@byosoft.com.cn> Signed-off-by: Xiaoqiang Zhang <xiaoqiang.zh...@intel.com> --- MdeModulePkg/Core/Dxe/Hand/Handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c index 24e4fbf5f3..daad09cddd 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c @@ -68,7 +68,7 @@ CoreValidateHandle ( ASSERT_LOCKED (&gProtocolDatabaseLock); - for (Link = gHandleList.BackLink; Link != &gHandleList; Link = Link->BackLink) { + for (Link = gHandleList.ForwardLink; Link != &gHandleList; Link = Link->ForwardLink) { Handle = CR (Link, IHANDLE, AllHandles, EFI_HANDLE_SIGNATURE); if (Handle == (IHANDLE *)UserHandle) { return EFI_SUCCESS; -- 2.45.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120126): https://edk2.groups.io/g/devel/message/120126 Mute This Topic: https://groups.io/mt/107630731/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-