It's actually a good question. It boils down to being eager vs lazy, both approaches have their own advantages and problems. I advocate for the lazy approach as it helps doing more global optimization, for example if you 'take' a fee elements from the collection, it would have been a big waste to calculate the map on the rest of the list. The same can also be said for operations like filter and match.

By nature, any method doing aggregate functions will also compile the results, so compiling blindly could also mean don't extra work for nothing.

As savant said, it is also possible that you just want to do operations with a variable. This is in most of the cases true when displaying variables in a view template