Favor local vars for highly used globals
Merge pull request #2 from cyx/optimizations

Favor local vars for highly used globals