"Cached set of entries."

5 views
Skip to first unread message

Stefan Reich

unread,
Dec 25, 2017, 9:54:21 PM12/25/17
to fastutil
Hi guys,

OK, one more question please. I'm referring to these fields in Object2IntRBTreeMap:

  /** Cached set of entries. */
protected transient ObjectSortedSet<Object2IntMap.Entry <K> > entries;
/** Cached set of keys. */
protected transient ObjectSortedSet <K> keys;
/** Cached collection of values. */
protected transient IntCollection values;

Are these necessary? I'm trying to reduce memory consumption as far as possible.

Many greetings,
Stefan

Sebastiano Vigna

unread,
Dec 26, 2017, 11:21:36 AM12/26/17
to fast...@googlegroups.com
Well, they are cached values. If you use at most exactly once the associated methods (entrySet(), etc.), they do not help. If you use them more than one, the reduce the memory footprint by avoiding the creation of functionally identical copies. Only you can decide.

Ciao,

seba

Reply all
Reply to author
Forward
0 new messages