-
Notifications
You must be signed in to change notification settings - Fork 2
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
[MISC] Extend insert_iterator #237
Conversation
Documentation preview available at https://docs.seqan.de/preview/seqan/hibf/237 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #237 +/- ##
==========================================
- Coverage 99.63% 99.58% -0.05%
==========================================
Files 51 51
Lines 1929 1951 +22
Branches 5 5
==========================================
+ Hits 1922 1943 +21
- Misses 7 8 +1 ☔ View full report in Codecov by Sentry. |
bd5bf90
to
0064974
Compare
0064974
to
de5ff0a
Compare
de5ff0a
to
67fc3d7
Compare
67fc3d7
to
ab11bf9
Compare
0a85177
to
4db94e8
Compare
4db94e8
to
06f1885
Compare
c6c0c12
to
b80ff97
Compare
851d3d8
to
f2cb10f
Compare
f2cb10f
to
c3279a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry! one more thing: When moving to a fast layout or partitioned IBF I need to compute not only hyperloglog sketches but at the same time minHash sketches. Before I had the kmer set and then computed the respective sketches from that. Now I could use the function type I guess? Or I could still use the set.
(min hash sketches is a small heap that gets updated with every new kmer for the XXX smallest kmers in the set).
explicit constexpr insert_iterator(function_t & fun) : ptr{std::addressof(fun)}, type{data_type::function} | ||
{} | ||
|
||
[[gnu::always_inline, gnu::flatten]] constexpr insert_iterator & operator=(uint64_t const value) noexcept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this function be constexpr? The type
in the switch case is not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type
would be known in a constant expression, but what isn't allowed in constexpr is casting from void *
.
Made it inline instead.
c3279a4
to
76202c1
Compare
Didn't really get faster when using a function. |
For our
compute_sketches
benchmark, this is around 10-14 times faster.We could also add an overload for the ibf, which then just calls
emplace
.This could be used in
insert_into_ibf
and the IBF ctor, where we currently first put the hashes in a set or vector before inserting.Numbers are iterations.
Clang apparently optimizes way better than GCC.
Clang with inline
= remove[[gnu::noinline]]
fromvoid invoke_without_inlining