Considerations

When designing applications, we ought to determine what is the most important thing that is valued by our users. Similarly, when working on data analysis or data science projects, we should think about what we care about the most. A customer-first approach is essential in any decision-making process.

Let's assume that our priority is to achieve better performance. Then, the next question is which part of the system requires optimization? If the part is slowed down due to the use of an array of structs, how much do we gain in speed when we employ the struct of arrays pattern? Is the performance gain noticeable—is it measured in milliseconds, minutes, hours, or days?

Further, we need to consider system constraints. We like to think that the sky is the limit. But then coming back to reality, we are limited in system resources all over the place—the number of CPU cores, available memory, and disk space, as well other limits imposed by our system administrators, such as, maximum number of opened files and processes.

While struct of arrays can improve performance, there is an overhead in allocating memory for the new arrays. If the data size is large, the allocation and data copy operation will take some time as well. 

In the next section, we will look into another pattern that helps to conserve memory and allows distributed computing shared arrays. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.216.229