-
-
Notifications
You must be signed in to change notification settings - Fork 327
Simplify reverse tuple iteration #1161
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
Conversation
@vittorioromeo thank you for this PR. Please resolve the conflicts to be able to run CI tests |
56d453d
to
e730fee
Compare
Should be fine now :) |
@vittorioromeo did you test compilation time with your branch? I am actually not sure whether reverse tuple iteration is used anywhere so I am not sure whether your fix will make much effort |
I saw a very small improvement of average 24ms per instantiation of |
This is awesome C++! Thanks @vittorioromeo for thinking along. I doubt that this change alone will improve compilation times overall. By the way, there is good reading about this fold expression trickery: |
dev/functional/index_sequence_util.h
Outdated
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.
BTW, we might implement first_index_sequence_value()
as follows. What do you think?
template<size_t... Idx>
SQLITE_ORM_CONSTEVAL size_t first_index_sequence_value(std::index_sequence<Idx...>) {
static_assert(sizeof...(Idx) > 0);
size_t result;
((result = Idx, true) || ...);
return result;
}
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.
Compared to the current implementation, I'm not sure it's going to be faster. I would recommend a benchmark on https://www.build-bench.com/
@vittorioromeo thanks! |
Should help a bit with #1160. Would also be nice to see how it interacts with #1055