2 ms·
Your example is a straw man. IRL, I've seen this crop up while processing database results and large datasets. On several occasions I've shaved up to several
by jlarocco 11y ago
Your example is a straw man.
IRL, I've seen this crop up while processing database results and large datasets. On several occasions I've shaved up to several minutes off of execution times by replacing chained map, filter, and zip calls that were iterating through the data multiple times with more complicated expressions that only performed the iteration once.
I've also written a graphics applications where converting several chained map/filters into a single pass made interacting with the application noticeably less laggy.
I'm actually surprised so many people have challenged this as a potential pitfall. I didn't pull it out of the air or from trivial examples. I've seen it happen.