The answer to your question depends on the compiler and optimizations.
With a recent GCC compiler with optimizations of at least -O1 arr[] will not be faster than s1.sArr[] . In fact, if for some reason (for example, its other fields) s1 more aligned than arr , then it may happen (due to cache effects) that s1.sArr[] may be slightly better (for example, because it is more aligned cache line size). But really, in terms of performance, using arr[] or s1.sArr[] (almost basically) is the same.
For ease of reading, things can be different. You may want to pack related items into some struct . (And you can avoid too many variable names).
source share