Optimization is effective when function arguments are used. It is usually better to pass a value as an argument to a function than to let the function take the value from a global variable.
The #pragma isolated_call preprocessor directive lists functions that have no side effects. Using the pragma to list functions that do not have side effects, that is, that do not modify global storage, can improve the runtime performance of optimized code.
Writing Optimized Code... Overview Variables Pointers Functions Expressions Critical Loops Conversions Arithmetic Conversions Inlined Components