Local variables tell the compiler to try to use a CPU register to store a value rather than store it in memory. This makes a lot of sense if you are going to be accessing the same values many times or want to work with a relatively small number of variables often. If you are doing lots of bigger memory access or parts of your code are quite different and not re-used much then you might not see any benefit. I try to use as many locals as possible and I never think about the garbage collector (that's the point of it). If I a coding tighter loops or doing lots of calculations I particularly try to put values into locals and generally the code does run faster. I would definitely avoid making all your variables global.