rvalues -> ref (yup... again!)

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 27 20:38:35 UTC 2018


On Tue, Mar 27, 2018 at 08:25:36PM +0000, Rubn via Digitalmars-d wrote:
[...]
> _D7example__T3fooTSQr3FooZQnFNbNiNfQrZv:
>   push rbp
>   mov rbp, rsp
>   sub rsp, 3104
>   lea rax, [rbp + 16]
>   lea rdi, [rbp - 2048]
>   lea rcx, [rbp - 1024]
>   mov edx, 1024
>   mov rsi, rcx
>   mov qword ptr [rbp - 2056], rdi
>   mov rdi, rsi
>   mov rsi, rax
>   mov qword ptr [rbp - 2064], rcx
>   call memcpy at PLT    <--------------------- hidden copy
[...]

Is this generated by dmd, or gdc/ldc?

Generally, when it comes to performance issues, I don't even bother
looking at dmd-generated code anymore.  If the extra copying is still
happening with gdc -O2 / ldc -O, then you have a point. Otherwise, it
doesn't really say very much.


T

-- 
People tell me that I'm skeptical, but I don't believe them.


More information about the Digitalmars-d mailing list