Avoiding array creation side-effects in performance critical areas

On iOS (AOT compiler), Array/Vector.push and  Math.min/max cause the creation of temporary arrays.