且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是最有效的Java Collections库?

更新时间:2023-11-25 11:30:40

看起来Trove只是一个原始库类型 - 这不是想在JDK的正常集合中添加很多功能。

From inspection, it looks like Trove is just a library of collections for primitive types - it's not like it's meant to be adding a lot of functionality over the normal collections in the JDK.

个人(我有偏见)我喜欢 Guava (包括前Google Java Collections集合项目)。它使各种任务(包括集合)更容易,在一种至少相当有效的方式。鉴于收集操作很少在我的代码中形成瓶颈(根据我的经验),这比收集API更好,但可能更有效,但不能使我的代码可读。

Personally (and I'm biased) I love Guava (including the former Google Java Collections project). It makes various tasks (including collections) a lot easier, in a way which is at least reasonably efficient. Given that collection operations rarely form a bottleneck in my code (in my experience) this is "better" than a collections API which may be more efficient but doesn't make my code as readable.

由于Trove和Guava之间的重叠几乎为零,因此您可以从集合库中找出您实际需要的内容。

Given that the overlap between Trove and the Guava is pretty much nil, perhaps you could clarify what you're actually looking for from a collections library.