2

Three questions:

  1. 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?

  2. Likewise for a sorted heap class

  3. (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

Alex Averbuch
  • 3,245
  • 5
  • 33
  • 44

2 Answers2

5
  1. No, GS Collections doesn't have Queue implementations yet. You could raise a request in the issue tracker.
  2. 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.
  3. 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.
Craig P. Motlin
  • 26,452
  • 17
  • 99
  • 126
2

Not sure about GS collections and your cases, but you also might be interested in these libraries:

leventov
  • 14,760
  • 11
  • 69
  • 98
  • I tried a JCTools MPSC Bounded queue (that fits best with current design), and it was more than 2x faster than LinkedBlockingQueue, for my use case. Thanks! I think I'll try Disruptor next, for comparison. – Alex Averbuch Dec 30 '14 at 17:32