Should I pass numbers and Strings (and other things which implement Copy by reference if I'm not moving the value? Is the compiler smart enough to realise that nothing is being changed and so magically replace the Copy and insert a reference for me?
It just feels weird to pass numbers by reference, but I can't justify that. Should I just be passing by reference when not moving?
You have to keep in mind that modern CPUs are incredibly fast, but latency of RAM have stopped advancing decades ago.
This leads to perverse situation where copying [u8; 1024] takes as much as traversing one, single “cold” reference.
Worse: even if switch from “saving memory via use of indirection is always beneficial” to today's “having ten copies of data is faster than one additional level of indirection” happened decades ago there are still books and courses around which teach you that using references is the best way to make your program faster.
Myth o of RAM series of blog posts describes what's happening pretty well.