News for hackers. Stuff that matters.
Re:Why aren't there C conferences? (2018) by Thiez on Friday August 26, 2022 @02:41PM (#32611173)
It seems that Wikipedia refers to them as "Strings as records"[1], which I suppose fits quite well. I suppose that C strings could be considered "the most" cache friendly since it has only 1 byte overhead instead of however many bytes would be required for the length (probably 4 or 8 bytes on most modern systems). That said, I would be extremely surprised for this difference of a few bytes per string to have a measurable performance improvement in anything but an unrealistic microbenchmark involving many tiny strings.

1: https://en.wikipedia.org/wiki/String_(computer_science)#Stri...

Re:Why aren't there C conferences? (2018) by WalterBright on Friday August 26, 2022 @02:53PM (#32611330)
0 terminated strings make sense for extremely tight memory cases, like 64Kb computers, and CPUs that don't cache memory. But they're a clear loser for 32 bit machines.