RoaringBitmap / RoaringBitmap/CRoaring
Improve the performance of roaring bitmap under sparse cases
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.9k
- Forks
- 334
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 17
Description
In a sparse roaringbitmap, the size of array_container may often be 1, 2, 3. But we can actually reuse the container pointer (sizeof(void*)) as an array of uint16_t to avoid extra memory allocation.
eg:
typedef struct roaring_array_s {
int32_t size;
int32_t allocation_size;
void **containers;
uint16_t *keys;
uint8_t *typecodes;
uint8_t flags;
} roaring_array_t;
roaring_array_t ra;
// some init code
ra.typecodes[i] = SINGLE_CONTAIN_TYPE + cardinality << 6;
((uint16_t*)ra.containers[i])[1] = value1;
((uint16_t*)ra.containers[i])[2] = value2;
((uint16_t*)ra.containers[i])[3] = value3;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the roaring_array_t container and typecode handling described in the issue, then inspect how sparse array containers are allocated and accessed. Measure sparse cases before changing anything, and confirm that the implementation reduces allocation overhead while preserving container values and existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100