Skip to content

Feature Request: optimized counter? #463

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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