is D so slow?
Fawzi Mohamed
fmohamed at mac.com
Mon Jun 16 07:40:16 PDT 2008
On 2008-06-16 16:32:56 +0200, Fawzi Mohamed <fmohamed at mac.com> said:
> On 2008-06-15 13:53:30 +0200, baleog <maccarka at yahoo.com> said:
>
>> Thank you for your replies! I used malloc instead of new and run time
>> was about 1sec
>
> But you probably did not understand why... and it seems that neither
> did others around here...
>
> Indeed it is a subtle pitfall in which it is easy to fall.
>
> When you benchmark
> 1) print something depending on the result like the sum of everything
> (it is not the main issue in this case, but doing it would have
> probably shown the problem), so you can also have at least a tiny
> chance to notice if your algorithm is wrong
>
> 2) NaNs
ehm, sorry...
You do initialize everything...
ehm, never post without testing...
Fawzi
More information about the Digitalmars-d-learn
mailing list