[Mono-devel-list] [PATCH] Field Layout Optimization
Jonathan Pryor
jonpryor at vt.edu
Sun Mar 14 18:48:54 EST 2004
On Sun, 2004-03-14 at 18:24, Ben Maurer wrote:
<snip/>
> * Is it correct to load strings that are stored in literal fields
> as interned. The reason I did this was to ensure that we dont
> create a string on each access (which is incorrect). However, I
> am not sure if it shoudl be interned.
See: http://blogs.msdn.com/cbrumme/archive/2003/04/22/51371.aspx
.NET automatically interns all strings literals inside the assembly when
the assembly is loaded. The blog notes that:
This is expensive and -- in retrospect -- may have been a
mistake. In the future we might consider allowing individual
assemblies to opt-in or opt-out.
For compatibility, we'll probably want to do the same, which is what
you're doing. So this is the path of least resistance. :-)
- Jon
More information about the Mono-devel-list
mailing list