The current sparsevec in base is actually using a 1-column SparseMatrixCSC 
data structure, which has some extra overhead. There's a more dedicated 
version in https://github.com/JuliaSparse/SparseVectors.jl and an 
associated PR to bring in the specific 1-D version of SparseVectors to fix 
a few inconsistencies, but it needs more work before it will be merged.

The sparse vector will more or less be a pair of arrays, one for the 
indices and one for the values. Dict will have to go through hash lookup, 
so if you know the indices are sorted integers and you'll only ever be 
appending to the end, I suspect a sparse vector might be a bit better 
choice.


On Tuesday, June 16, 2015 at 12:08:37 PM UTC-7, Jerzy Głowacki wrote:
>
> No, in my case the elements will always be appended at the end with 
> incremented key.
>
> E.g.: 1=>"aaa", 3=>"bbb", 9=>"ccc", 27=>"ddd", ...
>

Reply via email to