Hidden allocations when parallelizing with @batch

As @Benny has said, this will result in type instabilities. It should probably be

struct DimensionalData{D, T <: AbstractFloat}
    vectors::Tuple{Vararg{Vector{T}, D}}
    V::StructArray{SVector{D, T}, 1, Tuple{Vararg{Vector{T}, D}}, Int}

If you still get allocations, then you may need to PR StrideArraysCore to add explicit support for StructArrays as a pkg extension. Basically, object_and_preserve should turn the inner vectors into PtrArrays

2 Likes