问题
Three questions:
I was told the
gs-collections
library contains queue implementations but I can't find them in http://www.goldmansachs.com/gs-collections/javadoc/5.1.0/. do they exist? if so, which classes should I look at?Likewise for a sorted heap class
(Not so much of a question) Does anyone have any experience with the
gs-collections
library? It's totally new to me, so if you have any experience and advice regarding which tasks it's particular good at please share
Thanks in advance
回答1:
Not sure about GS collections and your cases, but you also might be interested in these libraries:
- https://github.com/JCTools/JCTools for very efficient concurrent queues
- http://fastutil.di.unimi.it for priority queues
回答2:
- No, GS Collections doesn't have Queue implementations yet. You could raise a request in the issue tracker.
- No, GS Collections doesn't have a sorted heap yet. As a first step toward supporting one, GS Collections could have a QueueAdapter which could wrap a java.util.PriorityQueue but add additional API.
- I am a developer on GS Collections. We're watching the gs-collections tag and can help. This is a broad question so I'll write a short answer here and you can write a new top level question if you'd like to go into it more.
GS Collections is particularly good when:
- You need a container that isn't provided by the JCF or other collections libraries, like Multimaps, Bags, BiMaps, primitive collections, or immutable collections.
- You run the JVM with a lot of memory / you have GC problems / you need memory-efficient containers. For example, UnifiedMap uses half the memory of HashMap and UnifiedSet uses a quarter of the memory of HashSet. Multimaps, Bags, and BiMaps are built on top of these more efficient structures.
- You want a rich API on your collections. Most collections implement RichIterable which provides many iteration pattern methods.
来源:https://stackoverflow.com/questions/27706930/looking-for-sorted-heap-concurrent-queue-in-gs-collections-library