On 02/11/2011 07:08 PM, bearophile wrote:
Jim:

I rarely need to go that low-level.

Two times I have had D1 code that was too much slow compared to equivalent C 
code. After profiling and some changes I have understood that the cause was an 
important missing inline. With a list of the inlined functions (as done by 
CommonLisp some compilers, see the enhancement request in Bugzilla), this 
search becomes quicker.


My hope is that the compiler will sort this out in the end. Give it some time, 
or effort to have these optimizations implemented in the compiler.

The LLVM back-end of LDC is able to inline much more, but even here a list of 
inlined/not inlined functions helps. D is almost a system language, so 
sometimes you need to go lower level (or you just need a program that's not too 
much slow).

To me the relevant aspect is not that much practical effect, but understanding how/why/what is inlined by (hopefully good) compilers. Learning about that, even if not much put in practice (I don't intend to write the next big language's compiler ;-) can only improve coding skills and, say... help and stop shooting in the dark.

Denis
--
_________________
vita es estrany
spir.wikidot.com

Reply via email to