Vectorization, broadcasting, and memory management