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

bearophile bearophileHUGS at lycos.com
Tue Jul 24 11:57:08 PDT 2012


David:

> align(1) struct Vertex {
>     float x;
>     float y;
>     float z;
>     float nx;
>     float ny;
>     float nz;
>     float u_terrain;
>     float v_terrain;
>     float u_biome;
>     float v_biome;
> }
>
> Everything is still a float, so it's easier. Nothing wrong with 
> that or? Well this change decreases my performance by 1000%.

Aligning floats to 1 byte doesn't seem a good idea. Try to remove 
the aling(1).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list