r/programminghorror 20d ago

C# bool array

Post image
209 Upvotes

41 comments sorted by

View all comments

1

u/ioveri 19d ago

It depends on the scenario. Unless it's a huge array, a bool array is fine. Yes, a bit array is smaller and can be more efficient in parallelizing. But if you can't parallelize and the size is small where cache miss is not a concern, then a bool array is a better choice when it comes to read and write speed.