4 ms·
> list-comprehensions are faster than loops Are they really though? In my experience you'll gain a couple of percent because you're getting rid of that call to
by Sean1708 9y ago
> list-comprehensions are faster than loops
Are they really though? In my experience you'll gain a couple of percent because you're getting rid of that call to append, but that's hardly the orders of magnitude OP was looking for.
- joshuamorton 9y agoYes, I wasn't saying they would fix this problem (they won't), but making the broader point that in general, more idiomatic/pleasant looking code is faster. This is neither of those, and so my hunch is that there are improvements that can be made to both form and function.