By ref and by pointer kills performance.

Johan j at j.nl
Tue Feb 13 13:42:30 UTC 2024


On Tuesday, 13 February 2024 at 13:30:11 UTC, Johan wrote:
> On Tuesday, 13 February 2024 at 03:31:31 UTC, Richard (Rikki) 
> Andrew Cattermole wrote:
>> dmd having bad codegen here isn't a surprise, that is to be 
>> expected.
>>
>> Now for ldc:
>>
>> ```d
>> void fillBP(immutable(uint*) value, uint* dest) {
>>      dest[0] = *value;
>>      dest[1] = *value;
>>      dest[2] = *value;
>>      dest[3] = *value;
>> }
>> ```
>>
>> I expected that to not do the extra loads, but it did.
>
> I hope someone can find the link to some DConf talk (me or 
> Andrei)

Found it: 
https://youtu.be/-0jcE9B5kjs?list=PL9a7lgBtSQb-YCVj96v5vn1tEXPjKOPuB&t=403


More information about the Digitalmars-d mailing list