bearophile wrote:
You can't ask a new open source language to have the features of a ten+ years
old commercial compiler.

Right, but dmd is using an optimizer and code generator that has been around for 25 years now. It's optimization is competent and reasonably advanced - the usual data flow optimizations are there, and the expected back end optimizations like register allocation using live range analysis and instruction scheduling are all there.

The back end can be improved for floating point, but for integer/pointer work it is excellent.

It does not do link time code generation nor profile guided optimization, although in my experiments such features pay off only in a small minority of cases. In my experiments on vector array operations, the improvement from the CPU's vector instructions is disappointing. It always seems to get hopelessly bottlenecked by memory bandwidth.

The dmd does have a built-in profiling tool, which is extremely effective in pinpointing trouble spots in the source code. For example, in the recent issue where the spell checker was slow, the profiler pointed the damning finger at exactly where the problem was. (It was an algorithmic problem, not an optimization problem.)

Just to brag about how good it can be, DMC++ remains by far the fastest C++ compiler available, and DMD is incredibly fast at compiling. Both are built with the same optimizer and code generator that DMD uses.

Reply via email to