J
John Rivers
I was playing around with using Dictionary<> to implement a sparse
array
using something like
class Key { byte x, y, z; }
where the "space" is 16,777,216 entries
but there are only ever going to be maximum of 10,000 entries
but it seems to me the internal hash array only grows - it never
shrinks
looking at the code with reflector shows a private Resize() method
that only
grows the number of buckets
ideally I would like something that would automatically recycle
buckets
and so not generate any garbage
any ideas?
array
using something like
class Key { byte x, y, z; }
where the "space" is 16,777,216 entries
but there are only ever going to be maximum of 10,000 entries
but it seems to me the internal hash array only grows - it never
shrinks
looking at the code with reflector shows a private Resize() method
that only
grows the number of buckets
ideally I would like something that would automatically recycle
buckets
and so not generate any garbage
any ideas?