High-performance Concurrent MultiMap Java/Scala

后端 未结 10 1275
無奈伤痛
無奈伤痛 2020-12-12 15:42

I am looking for a high-performance, concurrent, MultiMap. I have searched everywhere but I simply cannot find a solution that uses the same approach as ConcurrentHashMap (O

10条回答
  •  爱一瞬间的悲伤
    2020-12-12 16:09

    I made a ConcurrentMultiMap mixin which extends the mutable.MultiMap mixin and has a concurrent.Map[A, Set[B]] self type. It locks per key, which has O(n) space complexity, but its time complexity is pretty good, if you aren't particularly write-heavy.

提交回复
热议问题