So the difference between MiniMap and youre SmallMap is that your small map
can grow the arrays?
It could be then even be a replacement for MiniMap and the current maxValues
is the initialValue

Do make then your own read/write object. That is very simple. Make the 2
arrays transient.

johan


On 10/8/06, Matej Knopp <[EMAIL PROTECTED]> wrote:

Hi,

Currently we use HashMap as base implementation for ValueMap.
Since usually only few values are stored in ValueMap, i think it is a
bit overhead. I've made a simple implementation of map called SmallMap,
that uses array list for keys and another one for values.

The funny thing is, that when I use the SmallMap, serialized pagemaps
are even slightly bigger than HashMap. Because serialized hash map only
serialize keys and values, while I also serialize list length (twice).
Although this can be handled easily, just make own read/writeObject
implementation.

But I'd say that the runtime memory overhead of HashMap would be bigger
that SmallMap. Do you think we should change the map ValueMap is
extended from or leave it to be HashMap?

-Matej

Reply via email to