I have been twiddling with some performance geekness and created a small test to see if direct scoping the variables scope was faster than not scoping it, and I found some very interesting results. Scoping the variables scope was much slower than not doing it. It is shocking but true. Or maybe my test is foolish, judge for yourself and let me know.

Test Results 1:

Iterations: 30

Loops per Iteration: 5000

Avg No variables scope: 20.8333333333 ms

Avg. using variables scope: 43.7333333333 ms

Setup: Windows XP/IIS/CFMX 7.0.2



Test Results 2:

Iterations: 30

Loops per Iteration: 5000

Avg No variables scope: 4.7 ms

Avg. using variables scope: 11.9666666667 ms

Setup: Windows XP/IIS/CFMX 8 GMC

UPDATES:

Test Results 3:

Iterations: 30

Loops per Iteration: 5000

Avg No variables scope: 8.23333333333 ms

Avg. using variables scope: 17.1333333333 ms

Setup: Mac Intel/Apache/CFMX 7.02

Avg No variables scope: #arraySum(records)/iterations# ms

Avg. using variables scope: #arraySum(records2)/iterations# ms