JavaScript Optimization TestsThe following time tests are all performed by running 1,000,000 iterations and reporting results in milliseconds, averaged after 5 times. Some results are obvious, while others are surprising. These tests can be used as guidelines for optimizing code.Absolute Value (Integer)
Truncation
For Loops
Function Calls
Swapping Values
|