What is the relation of memory usage of a SparseArray
and the number of its occupied positions?
Let's say you build a 100000000Ă—10 SparseArray
and fill the two positions (1,1) and (100000000,10) with a value:
num = 999999;
idSparse = SparseArray[{{1, 1} -> num, {100000000, 10} -> num}]
There are two elements in the array.
Memory usage is:
ByteCount[idSparse]
400000968
Disk usage is:
Export["idSparse.rsa", idSparse];
FileByteCount["idSparse.rsa"]
380
Comments
Post a Comment