I reran the test by filling the table with string.Copy()'s of the strings instead of the constants, and indeed the string rand about twice as long as the integer test (I would have expected it to be even longer, given the length of the strings, so something is funny there).
I then manually interned this non constant string, and the test dropped back to the original performance figures.
So you would appear to be correct. Only constant strings are interned in the .net runtime. When they are, they are reference compared.
C//
Last edited by Courageous; 10-30-2006 at 02:23 PM.
|