Hello,
If one has a big structure, having lot of member variables. Some function needs to access 4-5 elements in the structure for its working, so which of the below scenario could be cache effective(less cache misses)-
1.) Pass the pointer to the structure as argument to the function, Which in turn will access the needed elements.(Assume that the elements are not continuous in the structure declaration and they are apart)
2.) Pass individual structure member variables as argument to the function.
In first place, Does this scenario affect performance of the code from cache perspective in first place?
Thanks.
-AD