Simple performance question from a newcomer

jmh530 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 23 14:11:27 PST 2016


On Tuesday, 23 February 2016 at 20:03:30 UTC, dextorious wrote:
>
> Personally, I think a few aspects of documentation for the 
> various compilers, dub and possibly the dlang.org website 
> itself could be improved, if accessibility is considered 
> important.

Couldn't agree more.

>
> Being new to the language, I certainly make no claims about 
> what the Phobos library should do, but coming from a heavy 
> numerics background in many languages, I can say that this is 
> the first time I've seen a common summation function do 
> anything beyond naive summation. Some languages feature more 
> accurate options separately, but never as the default, so it 
> did not occur to me to specifically check the documentation for 
> something like sum() (which is my fault, of course, no issues 
> there). Having the more accurate pairwise summation algorithm 
> in the standard library is certainly worthwhile for some 
> applications, but I was a bit surprised to see it as the 
> default.

I think that's fair. I think part of the reason for the focus on 
accuracy over speed is that floats can have really weird behavior 
sometimes. For most people, it's better to be a little slower all 
the time in order to get the right answer all the time (or as 
often as possible with floats).

And people who want more speed, can look at the docs and figure 
out what they need to do to get more.


More information about the Digitalmars-d-learn mailing list