title: Are hash codes of System.Type objects of types from the same assembly guaranteed to be unique?
body: <p><strong>Clarifying edit</strong>: The keys in the dictionary are actual instances of <code>System.Type</code>. More specifically every value is stored with its type as the key.</p>
  
  <p>In a specific part of my program the usage of <code>Dictionary&lt;System.Type, SomeThing&gt;</code> takes a large chunk of CPU time, as per Visual Studio 2017 performance profiler.</p>
  
  <p>A change in the type of the dictionary to <code>Dictionary&lt;int, SomeThing&gt;</code> and instead of passing the type object directly I pass the <code>type.GetHashCode()</code> seems to be about 20%-25% faster.</p>
  
  <p>The above optimization will result in a nasty bug if two types have the same hash code, but it seems plausible to me that types can have unique hash codes, at least when it comes to types from the same assembly - which all the types used in this dictionary are.</p>
  
  <p>Possibly relevant information - As per <a href="https://stackoverflow.com/a/10404544/940723">this answer</a> the number of possible types in an assembly is far smaller than the number of values represented by <code>System.Int32</code>.</p>