Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] emplace_exists #212

Merged
merged 1 commit into from
Jul 12, 2024
Merged

[FEATURE] emplace_exists #212

merged 1 commit into from
Jul 12, 2024

Conversation

eseiler
Copy link
Member

@eseiler eseiler commented Jul 11, 2024

Needed for dynamic HIBF.
emplace_exists is around 5% slower than emplace.

Copy link

vercel bot commented Jul 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hibf ✅ Ready (Inspect) Visit Preview Jul 12, 2024 4:04pm

@seqan-actions seqan-actions added lint [INTERNAL] used for linting and removed lint [INTERNAL] used for linting labels Jul 11, 2024
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (fead38a) to head (eb313d7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #212   +/-   ##
=======================================
  Coverage   99.67%   99.67%           
=======================================
  Files          47       47           
  Lines        1845     1852    +7     
  Branches        5        5           
=======================================
+ Hits         1839     1846    +7     
  Misses          6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eseiler eseiler requested a review from smehringer July 11, 2024 12:52
Copy link
Member

@smehringer smehringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just check if you really wanted to remove this one comment.

include/hibf/interleaved_bloom_filter.hpp Show resolved Hide resolved
Comment on lines +101 to +106
// Constructing the reference twice for emplace_exists would impact performance.
// No difference for emplace.
seqan::hibf::bit_vector::reference bit_reference{(*this)[idx]};
if constexpr (check_exists)
exists &= bit_reference;
bit_reference = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that

        if constexpr (check_exists)
            exists &= (*this)[idx];
        (*this)[idx] = 1;

Would construct the reference twice and is therefore slower?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would need to compute the bit position twice. Since there isn't much happening in emplace, doing it twice really affects performance.

emplace         50M/s
emplace_exists  47M/s
emplace_exists* 28M/s

* is with two references

@eseiler eseiler enabled auto-merge July 12, 2024 16:06
@seqan-actions seqan-actions added lint [INTERNAL] used for linting and removed lint [INTERNAL] used for linting labels Jul 12, 2024
@eseiler eseiler merged commit 36d2d19 into seqan:main Jul 12, 2024
37 checks passed
@eseiler eseiler deleted the feature/dynamic branch July 12, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants