Struct of arrays for Data-Driven Design

Hi!

I’m trying to understand data-driven design.

struct MyStruct
{
   TArray Transforms;

   TArray<FVector> Colors;
	
   TArray<int32> IDs;

   TArray<bool> Visible;

   TArray<FName> Names;

};

Would this be an effective approach to data-driven design? I ask because each array has a different data type and I can’t see how this would optimise the CPU cache.

Perhaps the optimisation would come from using arrays of the same data type, rather than using a structure containing data of different sizes as the data type of an array.

What do you think?

Thanks!

same type arrays is the part that helps the cache, since the loop only touches one type. keep the arrays the same length and walk them with the same index, or it gets messy fast.