You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you need to resize a lot, just allocate a “large enough” array and keep track of the dimensions you use at the momene. You can wrap this in a struct and implement the AbstractArray interface very simply.
Do you think this could be an option for us as well? After all, this is what many old-school Fortran/C/C++ simulation codes that use AMR do as well
Would it be an option to switch to Vectors as basic storage, which can be resize!ed if necessary, and use unsafe_wrapped Arrays to interface with them?
This would remove the need to provide a capacity that's big enough. We should then implement resize! (and maybe sizehint! etc.) for these containers/trees.
Copying a conversation from Slack:
@sloede
In some sense, that's what we are currently doing.
resize!
et al. allocate more memory than currently required to make growing faster for future calls, cf. JuliaLang/julia#31855. The relevant code is https://github.com/JuliaLang/julia/blob/master/src/array.c#L897-L905.Would it be an option to switch to
Vector
s as basic storage, which can beresize!
ed if necessary, and useunsafe_wrap
pedArray
s to interface with them?This would remove the need to provide a capacity that's big enough. We should then implement
resize!
(and maybesizehint!
etc.) for these containers/trees.@sloede:
So we should look into this once #200 is merged into
master
.Things to change
The text was updated successfully, but these errors were encountered: