Re: casting PositionNormalColored[] to byte[]

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.

.



Relevant Pages

  • Re: casting PositionNormalColored[] to byte[]
    ... I think that you're right about the premature optimization is a bad ... that pncs is just a pointer to the beginning of an array of structures. ... value, int offset, int count)!!! ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: char **argv & char *argv[]
    ... "pointer to pointer to char". ... >> pointer)) pointing to the first element of an array. ... so we have to start adding more context. ... type "pointer to char", rather than "array MISSING_SIZE of char". ...
    (comp.lang.c)
  • Re: why cannot assign to function call
    ... hypothetical C-like languages, ... sizeof business would still indicate that a pointer was being passed. ... talk about variables of an array type. ... the earlier version of the standard didn't have numbered ...
    (comp.lang.python)
  • Re: multi dimensional arrays as one dimension array
    ... please - where does the standard say that such a conversion ... Pointer conversion yields a pointer to the same object as ... exist only where there are array declarations. ...
    (comp.lang.c)
  • Re: Pointer Equality for Different Array Objects
    ... Pointers to the same object are pointers to the same region of data storage. ... A pointer comaprison (for exact equality, ... we have the vague ("if the array is large enough"). ...
    (comp.lang.c)