I've heard it said that passing by reference or pointer can be more efficient because it avoids a copy. I'm assuming this obviously doesn't apply for small arguments, for example doubles. Sometimes I deal with vec3 and vec4s which might be about 32 bytes big. I have a habit of passing by reference because I have this idea in mind, but I'm wondering if it's actually worth doing. IT makes sense that if copies are avoided it's faster, but how big would the argument generally need to be to gain anything? Are we talking about 8 bytes, 32 bytes? Or much bigger?
I'm not sure how passing by reference or pointer actually works under the hood anyway. For example is it possible it's actually slower with a reference because the memory address is used to retrieve the information when a simple copy would mean the object is available immediately.