looking for Sorted Heap & Concurrent Queue in gs-collections library

别等时光非礼了梦想. 提交于 2019-12-12 22:10:54

问题


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


回答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:


  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.


来源:https://stackoverflow.com/questions/27706930/looking-for-sorted-heap-concurrent-queue-in-gs-collections-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!