Slicing in Julia copies, which I knew and then forgot inside a loop. Take a function that walks the columns of a matrix and does s += sum(A[:, j]) for each j. Every A[:, j] builds a fresh vector, sums it, and throws it away. @time showed the allocations growing with the number of columns, and the performance tips call unexpected allocation almost always a sign of a problem.
view(A, :, j), or @views in front of the loop, makes the slice a SubArray that points into A, and the copying goes away.
The part that made me curious is what else @views changes. It turns every slice in the expression it wraps into a view, including ones on the right of an assignment. So x = A[:, j] inside a @views block gives you a view, and writing into x afterwards writes into A. Perfectly reasonable once you see it. Easy to miss if you put @views on a whole function to fix one loop and the function also copies a column on purpose somewhere further down.