Arrays of NamedTuples

I’m designing a package based on manipulating arrays of NamedTuples. Should I be aware of any performance pitfalls associated with such structures? In particular, while many use cases will have NamedTuples, the elements of which are of primitive type, I envision applications in which the elements are more complex, and non-constant in size.

yes, you should use Struct of Array representation, for example, see, StructArrays.jl or AwkwardArray.jl

Here, StructArrays won’t help much I think.

But together, array-of-namedtuples and structarray-of-namedtuples should fit all cases: just choose whether you want row-based or column-based storage, they have the exact same interface (:

These are convenient and performant datastructures, they work just fine in Julia! “Primitive” (isbits) types are stored inline, non-constant size values are stored as pointers.
Further recommendations would depend on the specifics of your usecase…