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

Merge metaprogramming loops #3613

Merged
merged 1 commit into from
Sep 7, 2024
Merged

Merge metaprogramming loops #3613

merged 1 commit into from
Sep 7, 2024

Conversation

schillic
Copy link
Member

The function _issubset_in_emptyset calls isempty. The removed loop used a shortcut for set types that are never empty, but the compiler figures that out and also skips isempty. So this was not really faster. Hence, I suggest to remove the loop to keep the codebase smaller.

@schillic schillic marked this pull request as ready for review July 25, 2024 15:53
@mforets
Copy link
Member

mforets commented Sep 7, 2024

The removed loop used a shortcut for set types that are never empty, but the compiler figures that out and also skips isempty.

that sounds quite advanced. how does it figure that out?

@schillic
Copy link
Member Author

schillic commented Sep 7, 2024

The removed loop used a shortcut for set types that are never empty, but the compiler figures that out and also skips isempty.

that sounds quite advanced. how does it figure that out?

Simply because isempty(X) = false is constant, and then the if isempty(X) can be optimized away.

@schillic schillic merged commit 9551ed7 into master Sep 7, 2024
7 checks passed
@schillic schillic deleted the schillic/simplify_issubset branch September 7, 2024 05:37
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