Today's GetFreeToken() runs at the algorithm complexity of O(n)
where n is the size of the token list.
The change introduces a new global variable FirstFreeToken and it
always points to the first free token. So the algorithm complexity
of GetFreeToken() decreases from O(n) to O(1).
The
Reviewed-by: Star Zeng
> -Original Message-
> From: Dong, Eric
> Sent: Friday, April 10, 2020 11:00 AM
> To: Ray Ni ; devel@edk2.groups.io
> Cc: Ni, Ray ; Zeng, Star
> Subject: RE: [PATCH v3] UefiCpuPkg/PiSmmCpuDxeSmm: Improve the
> performance of GetFreeToken()
>
> Reviewed-by: Eric
Reviewed-by: Eric Dong
> -Original Message-
> From: Ray Ni [mailto:niru...@users.noreply.github.com]
> Sent: Friday, April 10, 2020 10:51 AM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Dong, Eric ; Zeng, Star
>
> Subject: [PATCH v3] UefiCpuPkg/PiSmmCpuDxeSmm: Improve the
> performance of