D benchmark code review

logicchains jonathan.t.barnard at gmail.com
Fri Dec 13 05:56:21 PST 2013


On Friday, 13 December 2013 at 13:24:43 UTC, Rikki Cattermole 
wrote:
> Perhaps an alternative way to write it is like this:
> double
>  windX = 0,
>  runTmr = 0;
>
> You also have a lot of enums that like WIDTH and HEIGHT that 
> could be transformed into a single enum.
> e.g.
> enum int WIDTH = 800;
> enum int HEIGHT = 600;
>
> Would become:
> enum : int {
>  WIDTH = 800,
>  HEIGHT = 600
> }

I didn't realise D could do that; I've updated the code to use 
that style of variable declaration. It's interesting to be able 
to declare two arrays at once like so:

double[RUNNING_TIME * 1000]
     frames,
     gpuTimes;

Is there some way to initialise multiple values to zero without 
writing the zero more than once, so that the following only needs 
one zero:

double
     windX = 0,
     runTmr = 0;

I am timing, there just isn't much different in results between 
the different implementations. Why would you say not to use 
Derelict for bindings?


More information about the Digitalmars-d mailing list