Suppose I have a byte[]
and want to check if all bytes are zeros. For loop is an obvious way to do it, and LINQ All()
is a fancy way to do it, but highest performance is critical.
How can I use Mono.Simd to speed up checking if byte array is full of zeroes? I am looking for cutting edge approach, not merely correct solution.
Best code is presented below. Other methods and time measuring are available in full source.
Eventually it was beaten by this code:
Time measurements (on 256MB array):
Conclusions:
Posted this code on Peer Review, so far 2 bugs found and fixed.