title: C#: optimizing dictionary access (hash in key structures)
body: <p>So, I need to create a struct in C# that will act as a key into a (quite large) dictionary, will look like this:</p>
  
  <pre><code>private readonly IDictionary&lt;KeyStruct, string&gt; m_Invitations;
  </code></pre>
  
  <p>Problem is, I REALLY need a struct to use as a key, because it is only possible to identify entries via two separate data items, where one of them can be a null (not only empty!) string.</p>
  
  <p>What will I need to implement on the struct? How would you go about creating the hash? Would a hash collision (occassional) hurt the performance heavily or would that be negligible?</p>
  
  <p>I'm asking because this is "inner loop" code.</p>