D perfomance

drug drug2004 at bk.ru
Thu Apr 23 11:05:35 UTC 2020


23.04.2020 01:34, Arine пишет:
> On Wednesday, 22 April 2020 at 15:24:29 UTC, welkam wrote:
>> On Wednesday, 22 April 2020 at 14:00:10 UTC, serge wrote:
>>> My understanding that D is the language in similar ballpark 
>>> performance league as C, C++, Rust.
>> Equivalent implementation in C, C++, D, Rust, Nim compiled with same 
>> compiler backend should give exact same machine code. What you see in 
>> online language comparisons is mostly comparing different 
>> implementations and how much time people spent on optimizing.
> 
> Not quite. Rust will generate better assembly as it can guarantee that 
> use of an object is unique. Similar to C's "restrict" keyword but you 
> get it for "free" across the entire application.

You forget to add "in some cases Rust may generate better assembly than 
C/C++/D because..." But this is not the answer to the question OP asked. 
Rust has llvm based backend like ldc so nothing prevents ldc to be as 
fast as any other llvm based compiler. Nothing. The question is how many 
efforts you put into it.


More information about the Digitalmars-d mailing list