Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve shortcut performance when comparing two boolean expressions #667

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

dennis-tseng99
Copy link
Contributor

In original sbat.c:

else if (preserve_sbat_uefi_variable(sbat, sbatsize, attributes,
	                             sbat_var_candidate) &&
	 !reset_sbat) {

The time omplexity of preserve_sbat_uefi_variable() is higher than reset_sbat. Maybe we could swap both of them to calculate reset_sbat first. Such that the shortcut performance can be improved.

In original sbat.c:
...
else if (preserve_sbat_uefi_variable(sbat, sbatsize, attributes,
	                             sbat_var_candidate) &&
	 !reset_sbat) {
...

The time omplexity of preserve_sbat_uefi_variable() is higher than
reset_sbat. Maybe we could swap both of them to calculate reset_sbat
first. Such that the shortcut performance can be improved.

Signed-off-by: Dennis Tseng <[email protected]>
@vathpela vathpela merged commit 0345331 into rhboot:main Jan 15, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants