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

MP11 should be on metabench #3

Closed
odinthenerd opened this issue Mar 17, 2017 · 11 comments
Closed

MP11 should be on metabench #3

odinthenerd opened this issue Mar 17, 2017 · 11 comments

Comments

@odinthenerd
Copy link

I for one would like to see how mp11 stacks up in terms of compile time performance.

@pdimov
Copy link
Member

pdimov commented Mar 17, 2017

Any advice on what I need to do to get mp11 there? Neither Cmake nor Ruby are among my strong suits.

@odinthenerd
Copy link
Author

I' embarrassingly bad at both too but @brunocodutra was quite helpful to me getting brigand and kvasir on there so now I understand it enough to get myself into trouble. I'll see what I can do.

@odinthenerd
Copy link
Author

can you list the mp11 equivalent of each of the following algorithms (so I don't get anything wrong):
all
any
at
count_if
erase
filter
find_if
fold_left
fold_right
insert
partition
replace_if
reverse
sort
transform

its ok if you don't have implementations for some we can just leave them out.

@pdimov
Copy link
Member

pdimov commented Mar 17, 2017

#include <boost/mp11.hpp>
using namespace boost::mp11;

and then

mp_all_of<L, P>
mp_any_of<L, P>
mp_at<L, N> // or mp_at_c<L, N>
mp_count_if<L, P>
template<class L, class N> using erase = mp_append<mp_take<L, N>, mp_drop_c<L, N::value+1>>;
mp_copy_if<L, P>
mp_find_if<L, P>
mp_fold<L, V, F>
mp_reverse_fold<L, V, F>
template<class L, class N, class T> using insert = mp_append<mp_push_back<mp_take<L, N>, T>, mp_drop<L, N>>;
mp_partition<L, P>
mp_replace_if<L, P, W>
mp_reverse<L>
mp_sort<L, P>
mp_transform<F, L>

The list type is mp_list<T...>.

@pdimov
Copy link
Member

pdimov commented Mar 17, 2017

Incidentally, the benchmarks for find_if don't look correct, they look for n with the intent to find the last element, but the list contains n*k+1..n*k+n, so they don't.

@brunocodutra
Copy link

Indeed, thanks for pointing that out

@odinthenerd
Copy link
Author

I think I'm too stupid ;) I just can't seem to get the dependantcy to work. I'll add all the .erb and make a branch where someone else can get it working

@odinthenerd
Copy link
Author

@pdimov would like to talk a bit about your lib, can you provide an email or follow me on twitter do I can DM you?

@pdimov
Copy link
Member

pdimov commented Mar 21, 2017

Sure, pdimov at pdimov com.

@brunocodutra
Copy link

@odinthenerd I'll take it from there

@brunocodutra
Copy link

see ldionne/metabench#174

@pdimov pdimov closed this as completed May 18, 2017
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

No branches or pull requests

3 participants