title: C# Fastest performance for double array equality comparison
body: <p>Hi I'm trying to find the fastest way to compare two double arrays in C#. Happy to use unsafe if it is suitable. One of the biggest issues I've seen with byte compare solutions is I don't want to copy the double array to a byte array to do pinvoke for example. If there was a performant way of treating the double array as a byte array to pass to pinvoke memcmp call that would be great.</p>
  <p>This is the byte array compare solution I am referring to.
  <a href="https://stackoverflow.com/questions/43289/comparing-two-byte-arrays-in-net">Comparing two byte arrays in .NET</a></p>
  <p>I am aiming for faster than iterating and comparing the elements in two double arrays.</p>
  <p>For reference, my problem requires comparing these arrays approximately 10 trillion times. This component of the computation takes approximately 30% of the total in the operation so significant savings could be made here.</p>
  <p>Currently we're run .NET 4.6 - 4.8.</p>