Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
In DGM, each and eachWithIndex methods delegate to closure.call(argument) which creates a temporary array for each iteration. We can create the temporary array in the each method itself, then call closure.call(array) instead.
Another optimization would be to cache the MetaMethod used by the closure, but it would lead to slightly different semantics so we'll leave this for later.