in some perf critical program (single threaded), if I have arrays of primitive types, and need to access the same index of those more than once in loops.
Should I us
Array access always involves indirection, so if there are frequent accesses the variable will likely be faster.
That said, I find it incredibly unlikely that you will be able to measure the difference. This is an example of micro-optimization.