News for hackers. Stuff that matters.
Re:C’s Biggest Mistake by slaymaker1907 on Sunday July 02, 2023 @09:59PM (#36567815)
It takes 4-8 bytes to represent the size of the string versus 1 byte for a null terminator. That doubles the size of the string when you embed it in a struct or pass it as an argument on the stack. In particular, remember that even today cache lines are only 64 bytes for x86-64 and while that seems like a lot, going from 64 bytes to 68 means you go from 1 cache miss to load some struct to 2 cache misses.
Re:C’s Biggest Mistake by yakubin on Monday July 03, 2023 @04:09AM (#36570163)
Same as going from 64 to 65.