title: Comparison via Equals or HashCode. which is faster?
body: <p>I have to compare a object with the raw properties of the same class.
  Meaning, i have to compare those:</p>
  
  <pre><code>struct Identifier
  {
      string name;
      string email;
  }
  </code></pre>
  
  <p>with the two strings name and email.
  I know i could just create a new Identifier instance for name and email and pass that into equals(). My application has to be very fast and resource-saving.</p>
  
  <p>I know that comparison via hashcode isn't a good way, because as explained <a href="https://stackoverflow.com/questions/29714448/why-cant-i-just-compare-the-hashcode-of-two-objects-in-order-to-find-out-if-the">here</a> there are collisions. But collisions are okay for me, i just need it to be fast.</p>
  
  <p>So,</p>
  
  <p>1) is comparison via GetHashCode (check if the hashcode of both objects are the same) faster than Equals()?</p>
  
  <p>2)  Should i instead creating a new instance of Identifier of the two values for the comparison, make a new method which takes the values directly? e.g.</p>
  
  <pre><code>struct Identifier {
    string name;
    string email;
  
    bool Equals(string name, string email) {
        // todo comparison via hashcode or equals
    }
  }
  </code></pre>
  
  <p><a href="http://pastebin.com/nqhFqCDH" rel="nofollow noreferrer">I would use the Equals() and GetHashCode() method generated by resharper.</a></p>