java: sparse bit vector

后端 未结 7 2175
没有蜡笔的小新
没有蜡笔的小新 2021-02-08 07:24

Are there any well-known libraries in Java for sparse bit vectors?

(And are there guidelines for how sparse is useful to use them vs. java.util.BitSet?)

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-08 07:38

    TL;DR go here Efficient Sparse BitSet implementation in Java

    I know this is an "old" question, but having the same question I stumbled across this post. While the answers are good, I was ultimately not satisfied. After further digging, I think I've come across the "definitive" answer to the question of sparse BitSets in Java.

    In this presentation the author, Dr. Bruce Haddon, discusses the efforts of his researchers to create a highly memory-efficient and high-performance replacement for the standard Java BitSet.

    The original links to his presentation are dead, but I contacted Dr. Haddon and have preserved both the code and presentation here:

    https://github.com/brettwooldridge/SparseBitSet

    I cannot recommend reading this presentation more highly. It is a fascinating read even if you have no interest in sparse bit sets, it is more about the true nature of problem solving...

    Slides: Is it Computer Science, Software Engineering, or Hacking?

提交回复
热议问题