Inherent code performance advantages of D over C?

Walter Bright newshound2 at digitalmars.com
Mon Dec 9 14:08:10 PST 2013


On 12/9/2013 1:51 PM, Araq wrote:
> On Monday, 9 December 2013 at 20:38:34 UTC, Walter Bright wrote:
>> On 12/9/2013 11:45 AM, Araq wrote:
>>> On Monday, 9 December 2013 at 19:19:46 UTC, Walter Bright wrote:
>>>> On 12/9/2013 6:24 AM, Araq wrote:
>>>>> ("When in doubt, assume it modifies this location.")
>>> > And it's usually in doubt, often enough to make that > optimization a pipe
>>> dream.
>>> I disagree.
>>
>> I'm not without some experience with this - I have written a data flow
>> analysis optimizer (it's in dmd) and I know how they work.
>
> Well so do I.

Have you instrumented one and then run it on real programs to see how often 
certain optimizations can be applied? Because I have, and these sorts of 
optimization opportunities rarely occur. "It's always something" that prevents 
it because the worst possible case always is the one that rules.

It can be as simple as retrieving a pointer from a data structure. Or one of the 
callers to a function is getting its pointer from an API that you didn't have 
source for (like the operating system). Or it came from malloc(). Etc.


More information about the Digitalmars-d mailing list