Is D slow?
Laeeth Isharc via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Jun 9 13:18:24 PDT 2017
On Friday, 9 June 2017 at 19:29:35 UTC, Honey wrote:
> On Friday, 9 June 2017 at 18:32:06 UTC, Steven Schveighoffer
> wrote:
>> Wow, so that's how D code would look like if it were C++ :)
>
> Well, I cannot (and did not try to) hide where I am coming
> from. ;-)
>
>
>>> The results are quite disappointing. What seems particularly
>>> strange to
>>> me is that -boundscheck=off leads to a performance decrease.
>>
>> That doesn't make much sense, but I'm not an ldc2 user.
>> However, it does note in the help that -release disables
>> bounds checks already.
>
> Sounds like a bug, then.
>
>
>> I did replicate that issue on my box, and mucking around with
>> the implementation didn't help.
>>
>> In answer to the subject, no D is not slow. However, it's
>> quite possible that std.algorithm.bringToFront is slower than
>> std::rotate, or SortedRange.upperBound is slower than
>> std::upper_bound, or both. I don't think it's a design issue
>> per se, probably more of an implementation issue.
>
> Thank you for confirming the results and your factual
> explanation notwithstanding my pointed question. ;-)
>
> Maybe I was expecting too much given Andrei's performance
> oriented talks. I realize that the conceptual groundwork is
> more important than a concrete implementation that can be
> easily improved. However, I think that real world
> out-of-the-box performance - particularly with respect to toy
> examples (since those are small enough to be literally
> translated) - is important for prospects to gain confidence in
> buying into D.
>
> At the current state, at least for such benchmarks, I think, I
> should not rely on standard library facilities. Unfortunately,
> that does not increase my confidence.
Real world and toy are mutually exclusive categories, and I am
not sure the empirical evidence is consistent with your
perspective that it is what prospects need to see before
exploring D, though that is an interesting perspective. I
highly recommend Weka.io talks if you would like to see how one
larger D user has found performance in practice.
If you are expecting a perfectly finished glossy product then I
don't think that - at least in the current year - D will be
necessarily for you. Polish improves every year, but it's not
the principal focus of the community currently. It's more the
opposite - pay the price up front in different ways and reap the
returns again and again over time.
More information about the Digitalmars-d-learn
mailing list