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

Bitfield should have an is_disjoint method #14

Open
michaelsproul opened this issue Oct 24, 2023 · 0 comments · May be fixed by #15
Open

Bitfield should have an is_disjoint method #14

michaelsproul opened this issue Oct 24, 2023 · 0 comments · May be fixed by #15

Comments

@michaelsproul
Copy link
Member

To check whether two bitfields are disjoint you can use x.intersection(&y).is_empty(), however this allocates a new bitfield (vec-backed). If we can do this calculation without allocating it might improve attestation packing performance in Lighthouse, as this combination of calls is used extensively here:

https://github.com/sigp/lighthouse/blob/441fc1691b69f9edc4bbdc6665f3efab16265c9b/beacon_node/operation_pool/src/attestation_storage.rs#L128-L132

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 a pull request may close this issue.

1 participant