On 9/5/2012 5:01 PM, bearophile wrote:
Walter Bright:

I'd like it if you could add some instrumentation to see what accounts for the
time difference. I presume they both use the same D source code.

Maybe that performance difference comes from the sum of some metric tons of
different little optimizations done by the GCC back-end.

We can trade guesses all day, and not get anywhere. Instrumentation and measurement is needed.

I've investigated many similar things, and the truth usually turned out to be something nobody guessed or assumed. I recall the benchmark you posted where you guessed that dmd's integer code generation was woefully deficient. Examining the actual output showed that there wasn't a dime's worth of difference in the code generated from dmd vs gcc.

The problem turned out to be the long division runtime library function. Fixing that brought the timings to parity.

No code gen changes whatsoever were needed.

Reply via email to