Hey all, your help is appreciated in this problem!

This behavior is what I expect - when writing to a sparse matrix, no new 
memory is allocated if there are no changes to the sparsity structure

julia> A = spdiagm(ones(10000));

julia> x = randn(1,10000);

julia> @time A[1,1:10000] = x;
  0.241130 seconds (399.08 k allocations: 10.053 MB, 2.55% gc time)

julia> @time A[1,1:10000] = x;
  0.000606 seconds (36 allocations: 783.512 KB)

However, when try to do the same thing for block diagonal matrices, this 
does not work

julia> x = randn(2,10000);

julia> @time A[1:2,1:10000] = x;
  0.000906 seconds (37 allocations: 1.147 MB)

julia> @time A[1:2,1:10000] = x;
  0.000842 seconds (37 allocations: 1.261 MB)

julia> @time A[1:2,1:10000] = x;
  0.000916 seconds (37 allocations: 1.261 MB)

Is this a bug? Any help or workarounds are appreciated

Gabe

Reply via email to