Re: advantage of boxing and unboxing
- From: "RobinS" <RobinS@xxxxxxxxxxxxxxx>
- Date: Wed, 29 Nov 2006 22:36:49 -0800
In response to all the postings in response to this posting:
Sorry. I read a few books by Francesco Balena, and he
says that this should be minimized where possible. I went
back to find a specific reference, and this is one thing he
says that is confirmed by the other responses to this post:
In general, it doesn't make sense to compare the performance
of a method that uses boxing with a similar method that doesn't.
An informal benchmark shows that a tight loop that calls a function
that requires boxing can be up to 30 times slower than a loop that
doesn't use boxing. However, you must repeat the loop 10 million
times to see a meaningful difference in absolute terms, so in
practice you should worry about boxing only in time-critical
code sections.
So I apologize, and will be more careful in the future with
information that I post.
Robin S.
--------------------------------------
"RobinS" <RobinS@xxxxxxxxxxxxxxx> wrote in message
news:M9adncKhkuNBe_bYnZ2dnUVZ_sadnZ2d@xxxxxxxxxxxxxx
It takes a lot of resources, so it should be minimized.
Robin S.
---------------
<ahjiang@xxxxxxxxx> wrote in message
news:1164685131.738810.26120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi there,,
what is the real advantage of boxing and unboxing operations in csharp?
tried looking ard the internet but couldnt find any articles on it.
appreciate any help
.
- Follow-Ups:
- Re: advantage of boxing and unboxing
- From: Jon Shemitz
- Re: advantage of boxing and unboxing
- From: Bruce Wood
- Re: advantage of boxing and unboxing
- Prev by Date: Re: Is this the correct way to send a Bitmap over sockets?
- Next by Date: Re: .NET Grammar modification
- Previous by thread: Re: advantage of boxing and unboxing
- Next by thread: Re: advantage of boxing and unboxing
- Index(es):
Relevant Pages
|