Hi, I have some questions regarding bitvector32 and bitarray. 1.what is the difference between bitvector32 and bitarray? 2.what is the difference between bitvector32(1) and bitvector32(-1)? 3.why the performance of bitvector32 is greater than the bitarray? Regards Vinit
According to the MSDN: 'BitVector32 is more efficient than BitArray for Boolean values and small integers that are used internally. A BitArray can grow indefinitely as needed, but it has the memory and performance overhead that a class instance requires. In contrast, a BitVector32 uses only 32 bits.'
'BitVector32 is more efficient than BitArray for Boolean values and small integers that are used internally. A BitArray can grow indefinitely as needed, but it has the memory and performance overhead that a class instance requires. In contrast, a BitVector32 uses only 32 bits.'
BitVector32 is a struct and consumes only 4 bytes. BitArray is a class that has overheads associated with it and is therefore less efficient - BitArray will need at least 8 bytes before you've even added any objects to it as it lives on the heap.