DIP60: @nogc attribute

froglegs via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 16 15:11:21 PDT 2014


> I am really looking forward to .NET Native becoming widespread.
>
> Then this type of comparisons (C# vs C++) will be quite 
> different.


  I don't think it will make a major difference. Taking a GC based 
language and giving it a native compiler doesn't automatically 
make it performance competitive with C++(see Haskel and D(without 
dumping GC) on anything besides micro bench marks).

C# is still GC based, still makes heavy use of indirection(See 
Herb Sutters recent talk on arrays).

C++ exposes SSE/AVX intrinsics, C# does not.
Many programs don't use these, but if you have a few hot spots 
involving number crunching, they can make a major difference.

My current project spends about 80% of its CPU time in SSE 
amenable locations, some template magic mixed with SSE 
intrinsics, and now those spots run 4x faster.
  You might be thinking auto vectorization can compete, but I've 
yet to see the one in VS2013 accomplish much of anything.
   Also I doubt very much that an auto vectorizer can squash 
branches, which is very possible with intrinsics. True branches 
and vectorized code don't mix well...



More information about the Digitalmars-d mailing list