How fast is D compared to C++?

前端 未结 8 1949
陌清茗
陌清茗 2020-12-22 15:16

I like some features of D, but would be interested if they come with a runtime penalty?

To compare, I implemented a simple program that computes scalar products of m

8条回答
  •  不知归路
    2020-12-22 15:54

    This is a very instructive thread, thanks for all the work to the OP and helpers.

    One note - this test is not assessing the general question of abstraction/feature penalty or even that of backend quality. It focuses on virtually one optimization (loop optimization). I think it's fair to say that gcc's backend is somewhat more refined than dmd's, but it would be a mistake to assume that the gap between them is as large for all tasks.

提交回复
热议问题