I knew the C++ strings were optimized so. I do not like calling them "German". First time I see them called so (I know it, you can search yourself, as SSO -short string opt.), and looks as some kind of nationalist pride thing to me. Is certainly not a unique or new idea, many scheme/lisps implementations do that for strings AND numbers.
Downvotes coming from other connationals :) love you! I know… never say anything bad about Vaterland
C++ strings are not "optimized so". C++ strings (generally) do SSO (up to 23 bytes depending on implementation), these also do SSO but only 8 bytes (to a total of 12), the first 4 bytes are always stored inline for fast lookup even when the rest of the string is on the heap (in which case they're duplicated), and the strings are limited to 4GB (32 bits length). IIRC they also have a bunch of other limitations (e.g. they're not really extensible, by design).
Which is why they're "everywhere"... in databases, especially columnar storage.
Yes. Sorry. That was not 100% correct. Still, your words (my emphasis)
>C++ strings are not "optimized so". C++ strings (generally) do SSO (up to 23 bytes depending on implementation), these also do SSO but only 8 bytes (to a total of 12)
That is what I meant. I would (like you did) call it SSO still.
According to TFA, the name was coined by Andy Pavlo, who did his undergrad in New York, Doctorate in Rhode Island, and now teaches in Pittsburgh. I see no indication that he is German.
Andy Pavlo, ask anybody who knows him, is a very interesting character. I’m not sure if he really coined the name, or ist just a joke, as the one about his daughter (which I do both find funny at all). The database world (in which I was, is very interesting!) ;)
From TFA and AndyP's slides it seems to specifically refer to a variant of SSO where, for large strings, a fixed-sized prefix of the string is stored along-side the pointer, in the same location as that fixed-size prefix would be fore SSO strings. This means that strings lacking a common prefix can be quickly compared without pointer-chasing (or even knowing if they are small vs large).
Downvotes coming from other connationals :) love you! I know… never say anything bad about Vaterland