[Mono-devel-list] [PATCH] Field Layout Optimization

Ben Maurer bmaurer at users.sourceforge.net
Sun Mar 14 20:38:40 EST 2004

I am not so sure. For example, if you do something like:

[MyAttribute ("abc")]

And query for the attribute many times, the string is not interned. It
is different any time.

He might have been saying that all strings in the string heap are
interned at load.

-- Ben

On Sun, 2004-03-14 at 18:48, Jonathan Pryor wrote:
> 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
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list