An "open" BitSet implementation that allows direct access to the array of words
storing the bits.
Unlike java.util.bitset, the fact that bits are packed into an array of longs
is part of the interface. This allows efficient implementation of other algorithms
by someone other than the author. It also allows one to efficiently implement
alternate serialization or interchange formats.
is faster than in most operations
and *much* faster at calculating cardinality of sets and results of set operations.
It can also handle sets of larger cardinality (up to 64 * 2**32-1)
The goals of are the fastest implementation possible, and
maximum code reuse. Extra safety and encapsulation
may always be built on top, but if that's built in, the cost can never be removed (and
hence people re-implement their own version in order to get better performance).
If you want a "safe", totally encapsulated (and slower and limited) BitSet
class, use .
BitSet size = 1,000,000
Results are java.util.BitSet time divided by OpenBitSet time.
Test system: AMD Opteron, 64 bit linux, Sun Java 1.5_06 -server -Xbatch -Xmx64M
BitSet size = 1,000,000
Results are java.util.BitSet time divided by OpenBitSet time.
Namespace: Lucene.Net.UtilCopyC#
OpenBitSet
CopyC#
java.util.BitSet
CopyC#
OpenBitSet
CopyC#
java.util.BitSet
Performance Results
Test system: Pentium 4, Sun Java 1.5_06 -server -Xbatch -Xmx64MBitSet size = 1,000,000
Results are java.util.BitSet time divided by OpenBitSet time.
cardinality | intersect_count | union | nextSetBit | get | iterator | |
---|---|---|---|---|---|---|
50% full | 3.36 | 3.96 | 1.44 | 1.46 | 1.99 | 1.58 |
1% full | 3.31 | 3.90 | 1.04 | 0.99 |
Test system: AMD Opteron, 64 bit linux, Sun Java 1.5_06 -server -Xbatch -Xmx64M
BitSet size = 1,000,000
Results are java.util.BitSet time divided by OpenBitSet time.
cardinality | intersect_count | union | nextSetBit | get | iterator | |
---|---|---|---|---|---|---|
50% full | 2.50 | 3.50 | 1.00 | 1.03 | 1.12 | 1.25 |
1% full | 2.51 | 3.49 | 1.00 | 1.02 |
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1
Syntax
C# |
---|
[SerializableAttribute] public class OpenBitSet : DocIdSet, ICloneable |
Visual Basic |
---|
<SerializableAttribute> _ Public Class OpenBitSet _ Inherits DocIdSet _ Implements ICloneable |
Visual C++ |
---|
[SerializableAttribute] public ref class OpenBitSet : public DocIdSet, ICloneable |
Inheritance Hierarchy
System..::..Object
Lucene.Net.Search..::..DocIdSet
Lucene.Net.Util..::..OpenBitSet
Lucene.Net.Util..::..OpenBitSetDISI
Lucene.Net.Search..::..DocIdSet
Lucene.Net.Util..::..OpenBitSet
Lucene.Net.Util..::..OpenBitSetDISI