python generator vs for loop performance