this post was submitted on 14 Jan 2025
273 points (89.8% liked)
Programmer Humor
20006 readers
888 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Well, to get a boolean out of a bit array you have to do some operations. So at first it doesn't make it more performant. Compilers probably don't automatically make them bitarrays because of that.
However, the memory savings means less cache used. And a cache miss is way more expensive than those bit operations. So they should be more performant. I'm sure someone out there has done the actual research and there's a good reason why compilers don't make all booleans bitarrays.