Perlin noise benchmark speed

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 21 02:14:37 PDT 2014


On Saturday, 21 June 2014 at 05:00:25 UTC, dennis luehring wrote:
> Am 20.06.2014 22:44, schrieb bearophile:
>> dennis luehring:
>>
>>> it does not makes sense to "optmized" this example more and
>>> more - it should be fast with the original version
>>
>> But the original code is not fast. So someone has to find 
>> what's
>> broken. I have shown part of the broken parts to fix (floor on
>> ldc2).
>>
>> Also, the original code is not written in a fully idiomatic 
>> way,
>> also because unfortunately today the "lazy" way to write D code
>> is not always the best/right way (example: you have to add ton 
>> of
>> immutable/const, and annotations, because immutability is not 
>> the
>> default), so a code fix is good.
>>
>> Bye,
>> bearophile
>>
>
> as long as you find out its a library thing
>
> the c version is without any annotations and immutable/const 
> the fastest - so whats the problem with D here, it 
> can't(shouln't) be that one needs to work/change that much on 
> such simple code to reach c speed

bearophile's work is very valuable regardless of what the cause 
is, as it provides a pretty decent hint of what could be improved 
for anybody investigating the issue.

This is not to say that we wouldn't need to fix our compilers (in 
end user terms, i.e. compiler + standard library) to make those 
examples fast – zero-cost abstractions are one of the main 
strengths of D.

David


More information about the Digitalmars-d mailing list