microsoft / Range-V3-VS2015

A fork of the popular range-v3 C++ library with support for the Visual Studio 2015 Update 3 VC++ compiler.
Other
115 stars 22 forks source link

Performance issue (or misuse) #19

Open kreuzerkrieg opened 7 years ago

kreuzerkrieg commented 7 years ago

I'm trying to split stridden data to two components using range-v3. something like this

void foo(Buffer& input, Buffer& U, Buffer& V)
{
    V = ranges::move(input | ranges::v3::view::slice(0ull, input.size()) | ranges::v3::view::stride(2));
    U = ranges::move(input | ranges::v3::view::slice(1ull, input.size()) | ranges::v3::view::stride(2));
}

where the Buffer is defined as std::vector<uint8_t> For some reason it is very slow, about 20 times slower than naïve for loop. Am I doing something wrong? Is it me or library? Using VS2015 Upd.3