Skip to content

Feature Request: optimized counter? #463

@whyrusleeping

Description

@whyrusleeping

For my application i needed a way to track (up to some maximum) the number of likes for each of a number of given post IDs, and I'm already tracking sets of likes on posts by user using roaring bitmaps here, So I implemented a thing thats a fixed size stack of bitmaps that lets me compactly store counts by post ID.

To do the adding, I have a loop that takes in the new bitmap to add in, and then does a series of Xor and AndNot calls to do the 'Add' (see here: https://github.com/whyrusleeping/fancycounter/blob/main/fancycounter.go#L95-L100 )

I'm wondering if theres an optimized way we could do this in a single call (instead of an Xor and an AndNot separately)

Thanks in advance, and thank you so much for this library in the first place!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions