3 ms·
For what is worth, most "performance" idioms are anti-idioms on PyPy. Especially those: sum = 0 for d in data: sum += d product = 1 for d in data
by fijal 15y ago
For what is worth, most "performance" idioms are anti-idioms on PyPy. Especially those:
sum = 0
for d in data:
sum += d
product = 1
for d in data:
product *= d
Are much faster than reduce/map equivalents. The zip/dict example at the end is even more confusing. I'm convinced PyPy would be the fastest on the simplest-possible code (the first one, marked as "bad")