Microsoft working on new systems language

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Dec 29 07:26:38 PST 2013


On 12/29/13 6:35 AM, "Ola Fosheim Grøstad" 
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> On Sunday, 29 December 2013 at 13:46:07 UTC, Dicebot wrote:
>> This is not true. Assuming skilled use and same compiler backend those
>> are equally performant. D lacks some low-level control C has (which is
>> important for embedded) but it is not directly related to performance.
>
> That low-level control also matters for performance, when you have hard
> deadlines. E.g. when the GC kicks in, it not only hogs all the threads
> that participate in GC, it also trash the caches unless you have a GC
> implementation that bypasses the caches. Sustained trashing of caches is
> bad.

Yeah how about using deterministic deallocation in the inner loops - 
that's the only place where it matters.

> C has low-level, low resource usage defaults. While you can do the same
> in some other languages they tend to default to more expensive use
> patterns. Like D defaults to stuff like GC and thread-local-storage.
> Defaults affect library design, which in turn affect performance.
> (thread local storage requires either an extra indirection through a
> register or multiple kernel level page tables per process)

It is my opinion that safety is the best default at least here; global 
storage is very often an antipattern in singlethreaded applications and 
almost always so in multithreaded ones.. I think C got it wrong there 
and D is in better shape.


Andrei



More information about the Digitalmars-d mailing list