On Tue, Dec 10, 2013 at 11:47:47PM +0100, Sean Kelly wrote:
> On Friday, 6 December 2013 at 22:20:19 UTC, Walter Bright wrote:
> >
> >"there is no way proper C code can be slower than those
> >languages."
> 
> Didn't Bjarne cover this in his C++ performance talk at SD West in
> 2007?  Templates alone can make C++ and D code faster than even
> hand-optimized C.  And that doesn't even consider some of the other
> points you mentioned.

The thing is, what constitutes "proper C" is not well-defined, because
since C translates to machine code (as does C++ and D), in theory
*everything* has access to the same level of performance -- that is, the
hardware. So arguably, no matter what code fragment you may present in
C++ or D, there's always a corresponding C code fragment that performs
equally fast or faster. But that obscures the fact that said C code
fragment may be written in an unmanageably convoluted style that no one
in their right mind would actually use in practice. (And the same can be
said for C++ and D: use asm blocks, and you'll beat any "normal" C code,
but that proves nothing since the whole issue is writing *idiomatic* C
vs. *idiomatic* D, not writing things in an unnatural way just so you
can lay claim to the title of best performance.)


T

-- 
No! I'm not in denial!

Reply via email to