It appears that using [] around a generator expression (test1) behaves substantially better than putting it inside of list() (test2). The slowdown isn\'t there when I simpl
Your test2 is roughly equivalent to:
def test2(): def local(): for i in x: yield i return list(local())
The call overhead explains the increased processing time.