RoaringBitmap / RoaringBitmap/CRoaring
Use function pointers for runtime dispatching
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.9k
- Forks
- 334
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 17
Description
Rather than branching each time, consider doing something like this:
int (*run_container_cardinality)(const run_container_t *run) = run_container_cardinality_dispatch;
int run_container_cardinality_dispatch(const run_container_t *run) {
if (croaring_avx2()) {
run_container_cardinality = _avx2_run_container_cardinality;
} else {
run_container_cardinality = _scalar_run_container_cardinality;
}
return run_container_cardinality(run);
}
This way after the first call all calls will be direct. It may give a tiny performance gain.
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 run_container_cardinality_dispatch, run_container_cardinality, croaring_avx2, and the scalar and AVX2 implementations mentioned in the issue. Verify that runtime dispatch preserves existing behavior, then measure whether subsequent calls gain the proposed performance improvement.
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