STL icon indicating copy to clipboard operation
STL copied to clipboard

`minmax` 8 and 16 bit elements are not vectorized

Open AlexGuteniev opened this issue 1 year ago • 1 comments

Oversight in initial implementation in #4384. Noticed while benchmarking #4659

Might be superseded by #4453.

The optimization is performed in _Minmax_fwd_unchecked. We don't pick this branch for smaller elements, because _Prefer_iterator_copies evaluates to false.

https://github.com/microsoft/STL/blob/8dc4faadafb52e3e0a627e046b41258032d9bc6a/stl/inc/algorithm#L10417-L10420

AlexGuteniev avatar May 07 '24 09:05 AlexGuteniev

Great catch! We should be careful to avoid regressing perf for non-vectorized scenarios here.

StephanTLavavej avatar May 08 '24 21:05 StephanTLavavej