ecrypa
ecrypa
I just benchmarked two different approaches to obtain the index (instead of the value). The winner (currently in this PR) is [v17.ind.find](https://github.com/ecrypa/metal/blob/76b7e92beba803838fe440a35ebf3fdc3bc65d89/include/metal/list/min_element.v17.ind.find.hpp#L17). That was surprising to me, because my favorite...
For huge lists, it is slower than `find` ([Clang 9](https://ecrypa.github.io/metal-benchmark/min_element_clang9_v4_v19_messy/), [GCC 9](https://ecrypa.github.io/metal-benchmark/min_element_gcc9_v4_v19_messy/)). [v19](https://github.com/ecrypa/metal/blob/0962b6e008306a51f44df4a06cae688600e3a186/include/metal/list/min_element.v19.ind.transpose.hpp) is very close to your version, [v18](https://github.com/ecrypa/metal/blob/0962b6e008306a51f44df4a06cae688600e3a186/include/metal/list/min_element.v18.ind.transpose.hpp) is slightly optimized (but also slower than `find` for huge...
You can estimate the cost of recovering the index from the latest benchmarks. v11 is the fastest version, and it returns the value. v15 is my most favorite version, and...
Good news is that 39a5465 passes the [list example on GCC 4.7](https://ci.appveyor.com/project/brunocodutra/metal/builds/28439214/job/kpg8uglcs52r06v4#L67). Bad news is that it (v22) is [slower than higher-order metafunction (v4) on GCC 9](https://ecrypa.github.io/metal-benchmark/min_element_gcc9_v4_v22_gcc_fix/). Weirdly, [Clang 9](https://ecrypa.github.io/metal-benchmark/min_element_clang9_v4_v22_gcc_fix/)...
Nevermind, I was looking at MSVC out of habit. [GCC 4.7 still fails](https://travis-ci.org/brunocodutra/metal/jobs/604082788#L415) to compile the example. :-1:
For some reason, GCC 4.7 chooses the overload `value sfinae(...);` for the `min_element` example. I turned it into a hard error and reduced it to a [minimal example](https://godbolt.org/z/aT9ipi). Can you...