float[] → Vertex[] – decreases performance by 1000%

David d at dav1d.de
Fri Aug 24 13:16:40 PDT 2012


> Check the dissassembly view of this line:
> buffer[elements++] = Vertex(x, y, z, nx, ny, nz, u, v, u_biome, v_biome);
>
> If you are using an old version of dmd it will allocate an block of
> memory which has the size of Vertex, then it will fill the date into
> that block of memory, and then memcpy it to your buffer array.
>
> You could try working around this by doing:
>
> buffer[elements++].__ctor(x, y, z, nx, ny, nz, u, v, u_biome, v_biome);
>
> Kind Regards
> Benjamin Thaut

That's not the problem. The problem has nothing to do with the 
tessellation, since the *rendering* is also 1000% slower (when all data 
is already processed).


More information about the Digitalmars-d-learn mailing list