I am iterating through a large array (10^5 items) and performing an operation on each.
for (var row in rows) {
switch (operator) {
case "op1":
row += 1;
break;
case "op2":
...
case "opN":
break;
}
}
For testability and readability, I would like to extract that inner switch statement to it's own function, so the loop merely looks like
for (var row in rows) {
this.updateRow(row, operator);
}
Will the overhead associated with calling a function 10^5 times cause a noticeable performance penalty?