Re: 3D Points (structs vs classes)
From: cody (dont.spam.me.deutronium_at_gmx.de)
Date: 03/01/04
- Next message: Vishal Gupta: "investigating unmanaged memory"
- Previous message: Fuzzy: "Re: 3D Points (structs vs classes)"
- In reply to: Fuzzy: "Re: 3D Points (structs vs classes)"
- Next in thread: Fuzzy: "Re: 3D Points (structs vs classes)"
- Reply: Fuzzy: "Re: 3D Points (structs vs classes)"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Mar 2004 21:06:34 +0100
"Fuzzy" <trnospam@earthlink.net> schrieb im Newsbeitrag
news:9527b23b.0403011157.596130fb@posting.google.com...
> "Eric Gunnerson [MS]" <ericgu@online.microsoft.com> wrote in message
news:<u1dQnzM$DHA.2476@TK2MSFTNGP12.phx.gbl>...
> > To echo what Frank said, the 16 byte part is a guideline.
> >
> > The tradeoff is between the time taken in your type be a reference type
(ie
> > allocation and GC overhead and overall memory pressure) vs the time it
takes
> > to copy the struct as parameters and return types, and any boxing
overhead.
> >
>
> So what's your opinion of passing larger structs around as ref
> parameters and eliminating the copy?
using ref eliminates the copy but through the extra indirection access to
the struct can get slower, I think.
but for larger structs (>16 bytes or more) it may save time, but this highly
depends on the specific application.
the most important thing when dealing with structs is that you must be
always awre of boxing, because boxing can be the biggest performance hit.
-- cody [Freeware, Games and Humor] www.deutronium.de.vu || www.deutronium.tk
- Next message: Vishal Gupta: "investigating unmanaged memory"
- Previous message: Fuzzy: "Re: 3D Points (structs vs classes)"
- In reply to: Fuzzy: "Re: 3D Points (structs vs classes)"
- Next in thread: Fuzzy: "Re: 3D Points (structs vs classes)"
- Reply: Fuzzy: "Re: 3D Points (structs vs classes)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|