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

provide custom implementation of metal::partition (for performance) #124

Merged

Conversation

ecrypa
Copy link
Contributor

@ecrypa ecrypa commented Dec 1, 2019

No description provided.

@ecrypa ecrypa force-pushed the test/partition-no-workaround branch from 1318505 to bc50803 Compare March 1, 2020 13:09
@brunocodutra
Copy link
Owner

@ecrypa I notice this is still a draft, what's missing?

template<int_... ns, class... vals>
struct _partitioner<list<number<ns>...>, list<vals...>>
: _partition_joiner<
typename _partition_filter<ns>::template type<vals>...> {};
Copy link
Owner

Choose a reason for hiding this comment

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

Have we tested if_<number<ns>, pair<list<val>, list<>>, pair<list<>, list<val>>>... vs _partition_filter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have we tested if_<number<ns>, pair<list<val>, list<>>, pair<list<>, list<val>>>... vs _partition_filter?

I am not absolutely sure about that. I will benchmark it.

I remember why I once introduced that filter: What you propose here is similar to this pattern, which is the "GCC9 killer (v0)". I thus introduced the indirection via _fast_partition_helper in v2, which is faster on GCC9. When extracting the partitioner, I probably renamed _fast_partition_helper into filter.

Copy link
Owner

Choose a reason for hiding this comment

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

I'm happy to merge this as is either way and iterate on it later if necessary, unless you have plans for this PR still?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion! Feel free to merge.

@ecrypa ecrypa changed the title [CI only] test metal::partition implementation that has the best performance provide custom implementation of metal::partition (for performance) Mar 1, 2020
@ecrypa ecrypa marked this pull request as ready for review March 1, 2020 15:16
@brunocodutra brunocodutra merged commit bf6c3bc into brunocodutra:master Mar 1, 2020
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.

2 participants