-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Specialize find and count for vector<bool> #1131
Conversation
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.
reviewed use of bit, and some on functionality. I need to become more familiar with how vector works before I can give more functional feedback, but this should outline next steps.
Sorry it took me so long to get to this.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@barcharcraz can you give an update on the status of the builtins? |
we have no intention of adding the builtins, and they have been removed. We found the current way we implement these functions to be better given how our compiler is put together. You'll have to move popcount to some header that vector can include. |
3e60dda
to
149978e
Compare
Rebased and squashed down now using std::popcount |
cbfe024
to
5d3fbcd
Compare
@barcharcraz I believe this is ready for another round of review |
52ed289
to
9192585
Compare
I've pushed a merge with |
Thanks a lot, I was 99% sure that i already merge master. |
Urgh, Seems I has an unclean state and the use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@barcharcraz are there any further blockers here? |
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.
Approved with suggestions (it still needs final review). Also: before / after benchmarks would be awesome.
|
||
template <class _InIt, class _Ty> | ||
_NODISCARD _CONSTEXPR20 _InIt _Find_vbool(_InIt _First, const _InIt _Last, const _Ty& _Val) { | ||
// Find _Val in [_First, _Last) |
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.
this is not a super helpful comment and could be removed (we generally remove these sorts of comments when we see them, as there are many in older code). It doesn't need to block this PR though.
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.
I would keep it as we have it in all others
So I ran the itsy.bitsy benchmarks from the wonderfull @ThePhD The relevant results are for current version:
With this PR:
So we are still losing out against itsy.bitsy, which is not unexpected. But the performance increase is
I believe this is no too shabby |
@barcharcraz I added the optimizations to |
This reverts commit 21b4537.
Internal testing revealed that
|
Thanks for these order-of-magnitude speedups! 🚀 🚀 🚀 |
This builds uppon the recently merged specialization of
fill
forvector<bool>
.Note that the specializations require
__cpp_lib_bitops