DataStructures.jl
DataStructures.jl copied to clipboard
Fixed size container for buffer in CircularDeque
Would it make sense to switch from Vector as the container for buffer of CircularDeque (and potentially other fixed size containers)? Since we have Memory{T} and FixedSizeArray they could eliminate a pointer jump. Or the performance gain is expected to be negligible?
The concerns I see are:
- compatibility with older julia versions and
-
Base._unsetindex!trickery required for proper garbage collection as mentioned in https://github.com/JuliaCollections/DataStructures.jl/issues/884 and also discussed in https://github.com/julialang/julia/issues/58943
compatibility with older julia versions
We can always use a
if VERSION < v"1.11"
const Memory = Vector
end
or something like that
Base._unsetindex!
At least on the current version, this function is also overloaded for Memory.
This seems a fine change as far as the issues go
However, I am not sure if there is any performance or otherwise gain from doing this.