Perlin noise benchmark speed

Mattcoder via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 20 11:35:05 PDT 2014


On Friday, 20 June 2014 at 18:29:35 UTC, Mattcoder wrote:
> On Friday, 20 June 2014 at 16:02:56 UTC, bearophile wrote:
>> So this is the best so far version:
>>
>> http://dpaste.dzfl.pl/8dae9b359f27
>
> Just one note, with the last version of DMD:
>
> dmd -O -noboundscheck -inline -release pnoise.d
> pnoise.d(42): Error: pure function 
> 'pnoise.Noise2DContext.getGradients' cannot c
> all impure function 'core.stdc.math.floor'
> pnoise.d(43): Error: pure function 
> 'pnoise.Noise2DContext.getGradients' cannot c
> all impure function 'core.stdc.math.floor'
>
> Matheus.

Sorry, I forgot this:

Beside the error above, which for now I'm using:

immutable float x0f = cast(int)x; //x.floor;
immutable float y0f = cast(int)y; //y.floor;

Just to compile, your version here is twice faster than the 
original one.

Matheus.


More information about the Digitalmars-d mailing list