Slower than Python

Jonathan M Davis jmdavisProg at gmx.com
Mon Mar 4 00:18:22 PST 2013


On Sunday, March 03, 2013 23:40:18 Walter Bright wrote:
> On 3/3/2013 11:38 PM, Jacob Carlborg wrote:
> > On 2013-03-03 16:41, John Colvin wrote:
> >> I agree that anything that makes us faster is good, but I wouldn't go so
> >> far as to say we've failed if we're not as fast as the very fastest.
> > 
> > No, but if we need to drop down to C to get fast enough.
> 
> I can't think of a reason to need to do that.

Given how D works, there is something _very_ wrong if we have to drop to C, if 
nothing else, because it's trivial to write code in D which is equivalent to 
what it would be in C. If our implementation of something is worse than a C 
implementation, that merely means that it needs to be refactored and 
optimized. It's possible that some of our abstractions will hamper efficiency in 
some cases (e.g. depending on how ranges are used - particularly with strings 
- you risk a performance hit in comparison to pure C), but that should 
generally be fixable via specializations and whatnot.

If we have an efficiency problem, it's merely an implementation issue which 
needs to be sorted out. There should be nothing inherent to D which makes it 
so that you can't write code as fast as C or C++.

- Jonathan M Davis


More information about the Digitalmars-d mailing list