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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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]>
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.

1 participant