If I remember correctly, the small union optimization that makes Vector{Union{...}}
efficient has a limit of typemax(UInt8)
types in the union, but performance will degrade due to other compiler factors when going above 3-4 types. Unless this has changed since 2018 which it very well might have.
2 Likes