News for hackers. Stuff that matters.
Re:Libc++'s Implementation of std::string by scottlamb on Friday January 31, 2020 @01:14AM (#22199530)
Just a guess: the null byte is necessarily at the end of the 24 bytes rather than at the beginning. It might be in a different (typically 64-byte) cache line. Maybe one you don't need to read in from main RAM otherwise if you're handling a shorter string. That might make more of a performance difference than whether 23-byte strings (plus NUL byte) are short or long, depending on your application.

There are no comments on this comment yet.