[DGD]Resources used by sparse arrays
Cathy Willey
crwilley at provide.net
Fri Dec 15 19:43:18 CET 2000
In the system I'm designing, a situation has come up that can be
resolved in one of two ways: data can be stored in either a very sparse
string array (it might have 45 elements, with data in perhaps seven of
them), or the same data can be stored in two arrays: one with the
'index' where the data would have gone in the sparse array, and one with
the actual data. (A mapping won't work nicely due to what I'm doing with
it - trust me on this one. :) )
My questions to the more knowledgeable types are these: first, is more
memory going to be used by that array with 38 empty elements and seven
strings in it, or by an array of seven integers plus an array of seven
strings? Second, would the situation change if the arrays were smaller
(say, 5 out of 22 elements filled, or two five-element arrays) or more
densely packed (say, 15 out of those 45 elements filled)?
Thanks in advance for any advice.
Cathy Willey
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list