Does your game play fast enough on your target hardware?
What should l do?
- If so, stop making purely performance oriented changes.
- If not:
- Profile your game and discover the biggest bottleneck.
- Next, apply any algorithmic optimisations that are appropriate.
- Next, look at the memory access patterns and see if they can be made cache friendly.
- Finally, resort to lower level tricks as a last resort.
- Rinse and repeat.
That construct A might be faster or slower than construct B is not always important. For example, crippling your project's input architecture to save a handful of cycles per frame is not usually a smart engineering move.
The question then becomes, what analysis have you done to decide that a global is faster than a class member? Is it a general rule, or something specific to this case? Can it scale? Does the change have any impact elsewhere?