Get the latest tech news
Why German Strings Are Everywhere
German Strings Strings are conceptually very simple: Itâs essentially just a sequence of characters, right? Why, then, does every programming language have their own slightly different string implementation? It turns out that there is a lot more to a string than âjust a sequence of charactersâ1. Weâre no different and built our own custom string type that is highly optimized for data processing. Even though we didnât expect it when we first wrote about it in our inaugural Umbra research paper, a lot of new systems adopted our format.
Also, simultaneously accessing and modifying a string concurrently can lead to data races if we don’t use expensive locking techniques or think very carefully about our application. Besides the obvious advantage of saving a third of the overhead over std::string by dropping the capacity field, it also allows us to pass strings in function calls via two registers instead of putting them on the stack. The obvious advantage is that we save the 64 bits for the capacity field and can tightly pack payloads of different strings without gaps.
Or read this on Hacker News