Implement a workaround for julia#24909, using a suggestion by @KristofferC (code used with permission, modified by @tpapp, who is responsible for all bugs etc).
Probably not, unless push!
to Vector
is the bottleneck in your code.
This is just a demonstration, and will be deprecated when the issue above is fixed.
The single exported type is PushVector
, which can be push!
ed to. Use finish!
to shrink and obtain the final vector, but note that you should not use the original after that.
julia> v = PushVector{Int}()
0-element PushVector{Int64,Array{Int64,1}}
julia> push!(v, 1)
1-element PushVector{Int64,Array{Int64,1}}:
1
julia> finish!(v)
1-element Array{Int64,1}:
1