Skip to content

Bitfield should have an is_disjoint method #14

Description

@michaelsproul

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions