in reply to map vs for\foreach.
Picking your syntax based on benchmarks of trivial operations is total folly.
Use map if you want to get back a list. Don't otherwise.
Now, there can be non-trivial performance implications in similar syntax choices between for() and while() when reading from a (large) file, for example. But you also likely would not discover those from running benchmarks of trivial operations.
The benchmark results presented so far mostly illustrate differences in the trivial operations being done, not any performance difference that is likely to actually matter if you were changing useful code between map/for() [for cases of code where for() made sense].
- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: map vs for\foreach. (bench)
by tye (Sage) on Mar 12, 2015 at 05:40 UTC |