Currently compiled SQF global variable value get/set instructions include a look up of the variable in the namespaces global variable table. Since instructions are unique to the compiled code instruction list it would make sense to do this lookup initially in the constructor for the instruction and then store a reference to that global variable instead, so that the execute method is just referencing the reference instead of having to do a slow namespace search, that, often times is very repetitive.
Considerations that would have to be made is that global variables would essentially be pre-allocated, even if they are never used, though this seems like it would be minimal overhead as the GameValue objects contain just a pointer to the actual data (which is dynamically allocated and freed). Some changes in deleting/nilling out variables would also need to be made, the checks changing to see if the stored value pointer is null instead of if the name exists or not.
I believe that this change would fundamentally increase the performance of SQF dramatically with very little time investment in the actual code changes.
Changes to local variable access could also be made in a similar fashion through better stack allocation algorithms, but I have not investigated this fully.