[英]Java Hash Multi Map (key with multiple values) Implementation
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
.从这里,我发现 Colt 的
OpenIntIntHashMap
和 Trove 的 TIntIntHashMap 比 Java 内置的HashMap
或 Guava 的TIntIntHashMap
提供更好的性能和HashMultimap
使用。
Do Colt's OpenIntIntHashMap
or Trove's TIntIntHashMap
allow keys with multiple values, as with HashMultimap
? Colt 的
OpenIntIntHashMap
或 Trove 的TIntIntHashMap
允许具有多个值的键,就像HashMultimap
? If not what is a nice way to implement a HashMultimap
that can achieve Colt's or Trove's performance and memory efficiency?如果不是,什么是实现
HashMultimap
的好方法,它可以实现 Colt 或 Trove 的性能和 memory 的效率?
Note: I have tested Guava's HashMultimap
, but its performance and memory efficiency seems poor to me.注意:我已经测试过 Guava 的
HashMultimap
,但它的性能和 memory 效率对我来说似乎很差。
Multimaps.newSetMultimap(
TDecorators.wrap(new TIntObjectHashMap<Collection<Integer>>()),
new Supplier<Set<Integer>>() {
public Set<Integer> get() {
return TDecorators.wrap(new TIntHashSet());
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.