A bit array (also known as bitmap, bitset, bit string, or bit vector) is an array data structure that compactly stores bits.
A data structure for an array of single bit values, usually with emphasis on memory-efficient storage and performance.
You will probably find that bitvector performs a good deal better than bitarray
Performance improvement for mirroring bit matrix around the diagonal
Why is the bitvector 32 structure more efficient than bitarray
Why BitVector 32 structure is more efficient than BitArray?