-
Notifications
You must be signed in to change notification settings - Fork 41
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
Large number of allocations in 0.6.8 #228
Comments
ArraysOfArrays is fundamentally broken: JuliaArrays/ArraysOfArrays.jl#2. That can cause all sorts of trouble. |
Interesting, you mean the However, this issue is independent and will remain even when the ArraysOfArrays eltype is fixed so that |
I am also realizing that things are problematic for array types where the result of indexing is some custom type that has a reference to data from the original array, For example the same happens with julia> using WeakRefStrings
julia> sa = StringArray{WeakRefString}(["x", "y"])
2-element StringVector{WeakRefString}:
"x"
"y"
julia> push!(sa, "z")
3-element StringVector{WeakRefString}:
"x"
"y"
"z"
julia> push!(sa, convert(eltype(sa), "z"))
ERROR: MethodError: no method matching WeakRefString(::String) CategoricalArrays have the same issue: you can I imagine one would need to pick up between
Neither choice seems great, but I don't really see a clean way out of this. Maybe something along the lines of #229 is a reasonable compromise, but even then things are only fixed when the entry is passed as a tuple or named tuple. |
Maybe at some point this unrolling wouldn't be required? Maybe even at current julia versions? :) |
The eager automatic conversion introduced in #227 (cc @timholy @piever) leads to many allocations when this conversion isn't actually needed.
For example:
[email protected] - 25 allocations:
[email protected] - 1 million allocations:
Of course, these allocations go away if automatic conversion (
StructArrays.jl/src/utils.jl
Lines 197 to 199 in 1581d70
StructArrays.maybe_convert_elt(::Type{T}, vals::Tuple) where {T} = vals
.This change in 0.6.8 is highly breaking performance-wise. Can the new automatic conversion approach be revised and made less eager somehow?
The text was updated successfully, but these errors were encountered: