Optimize Loops
The less operations you do, the more processor time you save, the higher speed you have.
Javascript doesn't scope to blocks.
So, any variable declared in loop will be available after the loop and may override pre-existing globals!
Here some few points to get doing better:
- avoid repetitive access;
- break out earlier;
- choose the right loop type;
- organize your declarations;
- batch your operations;
No comments:
Post a Comment