02.10.2010, 16:45
These tests really don't matter. You're never doing any looping like this, so your benchmark doesn't resemble real world testing. Local and global variables both have their place in almost every language. This question is born out of ignorance. Remember the first rule of optimizing is, don't optimize until your code is slow. You need to be writing legible clear code above all else. If that code runs slow, then you need to benchmark and review your alternatives. Premature optimization is the root of all evil.