What is more efficient? 8 arrays int8 myArrayx[100], or a multidimensional int8 myArray[8][100]? I’m working with CCS compiler for Microchip PIC microcontrollers, and I need to write as fast as possible in a buffer, that is the reason of my question.
What is more efficient? 8 arrays int8 myArrayx[100] , or a multidimensional int8 myArray[8][100]
Share
i would have to think that the multi-dimensional array would be faster. you have a much, much better chance (possibly guaranteed?) of having those arrays being placed into memory in contiguous space whereas you can not be sure that the 8 individual arrays will be “close” together in memory – hurting your locality of reference.