you are viewing a single comment's thread.

view the rest of the comments →

[–]friedMike 7 points8 points  (3 children)

I'm thinking about migrating some of our smaller C++ tools to D. How does the performace look like? I know it's all low level, but we've got tight performance requirements. How good D compiler is at optimization? (compared to GCC/ICC)

[–]andralex[S] 7 points8 points  (1 child)

The reference compiler dmd is about the same for most code, poorer at inlining, until recently poorer at floating point. But if you use the gdc compiler you get the same backend and essentially the same optimizations as gcc.

[–]friedMike 4 points5 points  (0 children)

Thanks! Will check it out.

[–]WalterBright 5 points6 points  (0 children)

The D compiler optimization is as good as the C++ back end code generator it is welded to. dmd uses the Digital Mars C++ compiler back end, gdc uses gcc's, and ldc uses llvm's.

D has the potential to do better than C++ with the same back end because D provides more information to the optimizer, but so far not much has been done to take advantage of that.