4 ms·
We had that effort in C++. As we saw it backfired. C++ stdlib strings are so overengineered that they are much slower and bigger in the general case.
by rurban 7y ago
We had that effort in C++.
As we saw it backfired.
C++ stdlib strings are so overengineered that they are much slower and bigger in the general case.
- saagarjha 7y agoWhat? C++ strings have an overhead of 16 bytes+the space left in the backing buffer. That’s really not all that much.
- compiler-guy 7y ago16 bytes is in no way guaranteed by the standard.
- saagarjha 7y agoOf course–the implementation is free to do whatever it likes. But all reasonable ones will either use a three pointer (or some combination of a base pointer and pointers/integers representation bounds) or include a small buffer for SSO that overlaps with the storage for heap bounds.