12.09.2018 15:14, Timoses пишет:
On Tuesday, 11 September 2018 at 12:07:14 UTC, drug wrote:
If data size is less or equal to total size of available registers
(that can be used to pass values) than passing by value is more
efficient. Passing data with size less than register size by reference
isn't efficient because you pass pointer (that has register size) and
access memory using it.
Thank you!
So if I pass by reference it will ALWAYS use the address in memory to
fetch the data, whereas passing it by value enables the (compiler?..) to
use the register which has already loaded the data from memory (stack
for example)?
Honestly, I'm not an expert in this domain, but I think so.