Re: casting PositionNormalColored[] to byte[]
- From: flopturnriver@xxxxxxxxx
- Date: 2 Aug 2006 04:55:46 -0700
Thanks for you're quick responses.
I think that you're right about the premature optimization is a bad
thing. And that I indeed should focus on making it work. But it was
just something I couldn't realize in C#, and I don't like that.
Stephan Rose schreef:
On 2 Aug 2006 03:13:29 -0700, flopturnriver@xxxxxxxxx wrote:
My first solution did indeed copy individually vertices to the buffer.
After that i did made that subset and passed it at once to the buffer.
That did made it much faster. But I want more... more FPS... ;-). And
because the copy is a performance penalty...
But isn't it possible with unsafe code? Because, in c++ terms, is see
that pncs is just a pointer to the beginning of an array of structures.
So why can't i make an byte[] pointer that has the same address?
Oh, why didn't they made the buffer.Write(PositionNormalColored[]
value, int offset, int count)!!!
Copying an array with 350 vertices is rather insignificant
performance-wise. If you want to avoid the Copy then structure your
data in such a way that you don't need to copy.
Also remember, premature optimization is not a good thing! Write your
engine, get it functional, then identify your bottlenecks and worry
about optimizing the things that truly need it.
.
- Follow-Ups:
- Re: casting PositionNormalColored[] to byte[]
- From: Stephan Rose
- Re: casting PositionNormalColored[] to byte[]
- References:
- casting PositionNormalColored[] to byte[]
- From: flopturnriver
- Re: casting PositionNormalColored[] to byte[]
- From: Stephan Rose
- Re: casting PositionNormalColored[] to byte[]
- From: flopturnriver
- Re: casting PositionNormalColored[] to byte[]
- From: Stephan Rose
- casting PositionNormalColored[] to byte[]
- Prev by Date: Re: casting PositionNormalColored[] to byte[]
- Next by Date: Re: casting PositionNormalColored[] to byte[]
- Previous by thread: Re: casting PositionNormalColored[] to byte[]
- Next by thread: Re: casting PositionNormalColored[] to byte[]
- Index(es):
Relevant Pages
|