MultiMap vs MultiValue Map [英] MultiMap vs MultiValue Map

查看:164
本文介绍了MultiMap vs MultiValue Map的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某个地方,我必须使用映射到单个键的许多值的地图,所以我想知道使用 HashMap,列表之间是否存在显着的性能差异

解决方案

你可以尝试一下,但我怀疑有很大的区别,因为它做的事情也是一样的。



IMHO优点是更简单/更清晰的代码,通常比性能更重要。


At one place i have to use a map with many values mapped to a single key, so i was wondering whether there is any significant performance distinction between using HashMap of key, list and MultiMap of key , values in java.

解决方案

You can try it but I doubt there is much difference as it does much the same thing.

IMHO The advantage is simpler/clearer code which is usually more important than performance.

这篇关于MultiMap vs MultiValue Map的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆