Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting based on types #48

Open
Larbino1 opened this issue Mar 16, 2024 · 0 comments
Open

Sorting based on types #48

Larbino1 opened this issue Mar 16, 2024 · 0 comments

Comments

@Larbino1
Copy link

Larbino1 commented Mar 16, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant