D perfomance

SrMordred patric.dexheimer at gmail.com
Sat Apr 25 03:06:41 UTC 2020


On Friday, 24 April 2020 at 23:24:49 UTC, mipri wrote:
> On Friday, 24 April 2020 at 19:27:40 UTC, Arine wrote:
>> Rust:
>>
>>     pub fn foo(x: &mut i32, y: &mut i32) -> i32 {
>>         *x = 0;
>>         *y = 1;
>>         *x
>>     }
>>
>> example::foo:
>>         mov     dword ptr [rdi], 0
>>         mov     dword ptr [rsi], 1
>>         xor     eax, eax
>>         ret
>
> eh, this isn't Rust; it's "Rust +nightly with an unstable 
> codegen flag."
>
> Marginal codegen improvements aren't going to turn heavy usage 
> of
> dynamic arrays into heavy usage of std.container.array either, 
> so
> they're not that relevant to expected performance of real-world
> programs in D vs. other languages.

I believe that "-enable-scoped-noalias=true" should be the D 
equivalent (with LDC) but it didnt change anything.
Also u can achieve the same asm with @llvmAttr("noalias") in 
front of at least one argument.


More information about the Digitalmars-d mailing list