Are array/list lengths and string hashcodes memoized?
<p>Does anyone happen to know if, in .NET (4.0, if it matters), the Length property of an array, or the Count property of a <code>List&lt;T&gt;</code> is stored after it's been calculated, until the array/list is changed?</p>

<p>I ask because a record linkage program I'm working on is already horrifically complex enough as it is, and I'd rather not add another O(n) on top of things if I can help it.</p>

<p>Along similar lines, is the hashcode of an instantiated System.String memoized? Looking at it through the debugger, I can see that <code>List&lt;T&gt;</code> has a private _size member that <em>could</em> be where Count gets its value, but I see nothing for int[] or string indicating that they store it anywhere.</p>

<p>I can see the size vs. speed tradeoff, but can anyone tell me for sure if there are backing fields that hold these? For example, since in C#, strings are immutable, wouldn't it make sense to calculate the hashcode the first time <code>GetHashCode</code> is called, and just store it for every later use?</p>
