|
|
|
|
|
by GoblinSlayer
1655 days ago
|
|
Inefficiency is not due to the choice between for and map, but due to them executing many times. When you run a quadratic algorithm, it doesn't matter whether it's implemented with for or map, it's inefficient in both cases. Premature optimization is when you optimize based on assumptions as opposed to diagnosis of the problem. You believe the problem is due to for/map based on a priori reasoning. You also believe your code needs hyperoptimization before it had basic optimization. Well indeed why not, your code can't possibly be bad? |
|