Skip to content

disable fill_n optimization for msvc

Reference issue

What does this implement/fix?

Discord user LiliumAtratum noted that MSVC's fill_n is brutally slow on account of std::_Is_all_bits_zero, which is used to check if fill_n can be optimized to memset

Observations: the fill_n optimization appears to be a good thing for clang and gcc. newer implementations appear to optimize to memset if the argument is 0. I explored using a specialized implementation for setZero for std::is_arithmetic scalars which was universally better for gcc and clang, but only very marginally so. If this MR produces a performance regression in MSVC's setZero, then we can try it. chuckyschluz/eigen-chucky@master...better_zero

Additional information

Edited by Charles Schlosser

Merge request reports

Loading