for i in range(inputs_per_size):
    for n in range(1000):
        input = generate_random_input(size=n)
execution_time = get_execution_time(input)
if runtimes[n, i] > execution_time:
    runtimes[n, i] = execution_time
for n in range(1000):
    runtimes[n] = sum(runtimes[n, i] for i in range(inputs_per_size)
        ) / inputs_per_size
Unexpected performance curve from CPython merge sort