RoaringBitmap / RoaringBitmap/roaring

Feature Request: optimized counter?

Open
#463 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.9k
Forks
262
Avg merge
2h 34m
Merged PRs (30d)
8

Description

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!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with fancycounter.go lines 95-100, which are linked in the issue, and trace the Xor and AndNot operations used to add a bitmap. Then inspect the roaring bitmap API for related combined operations and determine whether the requested behavior can be supported as one call. Done means establishing whether an optimized operation is feasible and defining the needed library change.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.