I did an actual test to see the difference between local and global variables. It involved over 2 billion iterations of accessing local and global variables, so there should be plenty of accuracy.
First it runs
for(%a=0;%a<32768;%a++)
for(%b=0;%b<32768;%b++)
%y=8192;
To see how long it takes to set a local variable to a constant, timed of course.
Then it runs
for(%a=0;%a<32768;%a++)
for(%b=0;%b<32768;%b++)
%y=%x;
where %x is set to the same constant, again, timed.
Then it subtracts the first result from the second to get rid of the time it takes to do the for loop and to set the variable to the constant.
Then it does the same thing where the only difference is %x is set to $x.
The result should be, with great accuracy, how long it takes to access a local/global variable and nothing else.
The results were:
Local Variables:
457.636 nanoseconds per access
Global Variables:
449.523 nanoseconds per access
so there's a 1.8% difference.