Go is meant to be fast. The choice for pass by value or by reference for 
each embedded type was carefully chosen having that in mind.
Pass by value reduces the heap usage because function calls can make a 
value copy instead of keeping the value at the heap.
Whenever a value is passed by reference the compiler must keep the value in 
heap, just for the sake of sharing the address.
Reducing the heap usage alleviates the load for the garbage collector 
resulting in improved overall performance of the generated code.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to