[Mono-devel-list] Performance w/ boxing

Jaroslaw Kowalski jaak at zd.com.pl
Thu Feb 19 18:07:32 EST 2004


Is it possible to share the boxed objects in case when they hold the same
value? Considering the following statements:

object o1 = 2;
object o2 = 2;

Is it possible to have o1 and o2 refer to the same object on heap? What
about lock() on such objects?

Jarek
----- Original Message ----- 
From: "Michal Moskal" <malekith at pld-linux.org>
To: <mono-devel-list at lists.ximian.com>
Sent: Thursday, February 19, 2004 7:42 PM
Subject: Re: [Mono-devel-list] Performance w/ boxing


> On Thu, Feb 19, 2004 at 01:04:38PM -0500, Ben Maurer wrote:
> > Well, given that no objects are promoted past gen0 with the MS GC, I am
> > not sure how theirs is any better. (in a real life test, where there
> > were other allocations, their GC would obviously have an edge). Then
> > again, I will admit I do not know much about GCs ;-).
>
> I heard somewhere that GC in MS .NET have some special optimization for
> dealing with short lived objects.
>
> However mono performance isn't that bad with boxing. I have an application
> that uses boxing *very* extensively (the Nemerle compiler, it uses
> parametric polymorphism simulated with casting everything to object;
> and yes we're planning code generator using generics) and it doesn't
> perform *that* much better on MS runtime.
>
> -- 
> : Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
> : When in doubt, use brute force. -- Ken Thompson :: UL++++$ C++ E--- a?
> _______________________________________________
> 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