Re: Boxing and Unboxing ??



Peter Olcott <NoSpam@xxxxxxxxxxxxx> wrote:

<snip>

It is good to know that aggregate data can be passed by reference without the
boxing and unboxing overhead, if need be.

Normally aggregate data is stored in a reference type to start with,
where there's no boxing penalty anyway.

Last time you were concerned with the performance penalty of boxing and
unboxing, we proved that in the benchmark you were worried about, the
cost of boxing and unboxing was negligible. Now, do you have a
different evidence-based reason for worrying about the penalty? If not,
I'd suggest you get some more experience (and start profiling) before
worrying about it any more.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: Boxing and Unboxing ??
    ... boxing and unboxing overhead, if need be. ... where there's no boxing penalty anyway. ... In some cases a two-fold difference in the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: advantage of boxing and unboxing
    ... The only cases in which boxing / unboxing is likely to cause problems ... Garbage collector costs to reclaim the box when it's no longer ... resources, would something as simple as the following take alot of ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Roll your own std::vector ???
    ... dynamic collection that doesn't use any boxing or ... unboxing. ... public IEnumeratorGetEnumerator() ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Roll your own std::vector ???
    ... dynamic collection that doesn't use any boxing or ... unboxing. ... public IEnumeratorGetEnumerator() ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Boxing and Unboxing ??
    ... But, without evidence, you seem obsessed with boxing and unboxing. ... always avoid passing large aggregate data types by value. ... Now we have a function that is 100,000-fold slower than necessary ...
    (microsoft.public.dotnet.languages.csharp)

Loading