I have a set of arrays of hundreds of thousands flags 0 or 1.
I'm using the BitArray class for doing something like that:
result = (BitArray)ab.Clone();
result.And(bc);
many many times...
Of course I have to set the flags in Bitarray first.
for (int i = 1; i < maxLen; i++) ab[i] = a[i] < b[i];
But when I set the flags once then I'm doing thousands of operations and, or, xor, not on them (so the speed of the bitwise operations is much more important)
And again from the beginning.
I'm asking you if is in C# faster method for doing this?
Stopwatchclass to time real results in your application. This will be much more accurate than anything we can give you.BitArray.Andcompared to looping over all the bits and using&on each bit pair. If that isn't what you are asking about, please clarify your question.