Optimize a Python code to minimize program execution time
def sum_array(array):
    res = 0
    for i in range(len(array)):
        res += array[i]
    return res
def sum_array(array):
    return sum(array)