in reply to Speed comparison of foreach vs grep + map
Do you have a benchmarked application where the benchmark is showing that foreach/grep,map is the specific bottleneck and causing tens of seconds of extra run time? Because if not, choose the best tool to make the code as easy as possible to understand.
You will usually save a lot more time writing maintainable code than seeking the fastest runtime you can manage.
If you do need to improve runtime you should try to be smart rather than clever. A smart solution is likely to approach the problem from an entirely different direction. A clever solution is likely to be a nasty mess arrived at by iterative tweaking the code to squeeze the last drop of performance out of a sub-optimum algorithm.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Speed comparison of foreach vs grep + map
by eyepopslikeamosquito (Archbishop) on May 26, 2025 at 04:37 UTC | |
Re^2: Speed comparison of foreach vs grep + map
by mldvx4 (Friar) on May 26, 2025 at 09:25 UTC | |
by eyepopslikeamosquito (Archbishop) on May 26, 2025 at 10:24 UTC | |
by mldvx4 (Friar) on May 26, 2025 at 13:13 UTC |