r/ProgrammerHumor • • Oct 07 '26

Meme wasteOfPreciousSpace

Post image
7.3k Upvotes

244 comments sorted by

View all comments

Show parent comment

47

u/American_Libertarian Oct 07 '26

It’s not about saving literally one byte. But if you have a data structure that uses a lot of bools, compacting them can be the difference on fitting in a cache line or not. Or if you have a large array, you can fit multiple structs in a cache line.

Moral is: keeping your data compact is really really really important for performance. And bitfields are a good tool to keep data compact.

28

u/ScrotumNipples Oct 08 '26

How dare you preach best practices in my AI slopcoding meme sub.

1

u/ligma_then_sugma Oct 10 '26

does this mean that linked lists are based and not cringe?