From here , I found that Colt's OpenIntIntHashMap
and Trove's TIntIntHashMap
give better performance and memory uses than Java's built in HashMap
or Guava's HashMultimap
.
Do Colt's OpenIntIntHashMap
or Trove's TIntIntHashMap
allow keys with multiple values, as with HashMultimap
? If not what is a nice way to implement a HashMultimap
that can achieve Colt's or Trove's performance and memory efficiency?
Note: I have tested Guava's HashMultimap
, but its performance and memory efficiency seems poor to me.
Multimaps.newSetMultimap(
TDecorators.wrap(new TIntObjectHashMap<Collection<Integer>>()),
new Supplier<Set<Integer>>() {
public Set<Integer> get() {
return TDecorators.wrap(new TIntHashSet());
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.