News for hackers. Stuff that matters.
Re:Hunting Performance in Python Code: Measuring Memory Cons... by lilbobbytables on Thursday June 01, 2017 @10:47AM (#14460689)
Localizing append helps, but that's not all of it:

Building a list of 10,000,000 items:

List comprehension: 599ms For loop: 930ms For loop with append localized: 736ms

Re:Hunting Performance in Python Code: Measuring Memory Cons... by dom0 on Friday June 02, 2017 @09:58AM (#14469896)
Comprehensions have their own opcodes which directly call e.g. PyList_Append with no further checks or lookups in each iteration.