title: Reference equality performance difference? ((object)obj1 == (object)obj2) vs. object.ReferenceEquals( obj1, obj2 )
body: <p>Is there extra overhead in using the <code>object.ReferenceEquals</code> method verses using <code>((object)obj1 == (object)obj2)</code>?</p>
  
  <p>In the first case, there would be a static method call involved, and in both cases some form of casting to an object would be involved.</p>
  
  <p>Even if the compiler balances out those methods, what about inequality?<br></p>
  
  <pre><code>(object)obj != null
  </code></pre>
  
  <p>as compared to...</p>
  
  <pre><code>!object.ReferenceEquals(obj,null)
  </code></pre>
  
  <p>I suppose that at some point, a logical negation would occur, either within the != operator, or as applied to the result of the ReferenceEquals method.  What do you think?</p>
  
  <p>There's also the issue of readability to consider.  ReferenceEquals seems clearer when checking equality, but for inequality, one might miss the <strong><code>!</code></strong> preceding <code>object.ReferenceEquals</code>, whereas the <strong><code>!=</code></strong> in the first variation is hard to overlook.</p>