This example here shows how the order of types in can vary. In theory, the order of the tuple could be kept consistent, so that less types are created and less recompilation needs to be done.
julia> t1 = TypeSortedCollection(Any[1, 1.0])
TypeSortedCollection{Tuple{Vector{Int64}, Vector{Float64}}, 2}(([1], [1.0]), ([1], [2]))
julia> t2 = TypeSortedCollection(Any[1.0, 1])
TypeSortedCollection{Tuple{Vector{Float64}, Vector{Int64}}, 2}(([1.0], [1]), ([1], [2]))
julia> typeof(t1)
TypeSortedCollection{Tuple{Vector{Int64}, Vector{Float64}}, 2}
julia> typeof(t2)
TypeSortedCollection{Tuple{Vector{Float64}, Vector{Int64}}, 2}
I see you already have the preserve_order option, so this could be done without needing a major version change?
I wonder if you have any thoughts on how to decide the ordering, perhaps objectid on the types. Is there a better option?
This example here shows how the order of types in can vary. In theory, the order of the tuple could be kept consistent, so that less types are created and less recompilation needs to be done.
I see you already have the
preserve_orderoption, so this could be done without needing a major version change?I wonder if you have any thoughts on how to decide the ordering, perhaps
objectidon the types. Is there a better option?