On Thursday, April 14, 2016 at 8:38:33 AM UTC-4, James Fairbanks wrote: > > Is that from this package https://github.com/JuliaSparse/SparseVectors.jl > or somewhere else? >
Yes, and it was incorporated into Base in 0.5. It's basically a one-column SparseMatrixCSC. > > They should have *significantly* better performance than a dictionary in > many cases. > > What about performance of random order insertions? The structure I'd want > for fast linear algebra would be similar to one column of a csc matrix, > right? > > The workloads will have a relatively high ratio of insertions to reads, > and almost no bulk reads -- like you would have for a matvec. > > I guess one of the benefits of making the underlying storage type generic > is that you could do this comparison easily. > Yup, there are definitely places where the CSC format will struggle. The biggest advantage is when you can use specialized algorithms that only look at the stored elements — and the Base sparse implementation already has lots of those specializations in place (particularly for linear algebra, but other things like reductions, too). The two data structures will have very different algorithmic complexities and cache behaviors, so it'll all depend on how you use them. Your use-case may be a place where this kind of hashed array will shine. >