Max of a vector

Even for small arrays you have dynamic dispatch. (As opposed to tuples.) Of course, if you have lots of few-element arrays in performance-critical code then you might want to re-think your code structure anyway.

But it’s better (faster, cleaner, more idiomatic) to use the maximum function to find the maximum element of a collection. That’s what it’s there for.

5 Likes