This simple function is properly optimized into a memset by clang and gcc, but the latest MSVC with /O2 produces this inefficient code. Godbolt link:https://godbolt.org/z/hadjdh4PG buffer$ = 8 void zero_float_fill(float *) PROC ; zero_float_fill, COMDAT xorps xmm0,...
1 fill_n vs. for-loop to initialize an array 0 Why are the loops for memset() 1M times and 10M times cost the same time? 8 What performance can I expect from std::fill_n(ptr, n, 0) relative to memset? 5 Explanation for why allocating a second time changes performance 0 Why...