3 ms·
tl;dr: libc++ is just bad, libstdc++ and MSVC trade punches for first place, with the eyeball win going to the FSF. Though really the performance gates on stri
by ajross 2y ago
tl;dr: libc++ is just bad, libstdc++ and MSVC trade punches for first place, with the eyeball win going to the FSF.
Though really the performance gates on string-heavy code tend to be in the heap and not the string library itself.
- BeeOnRope 2y agolibc++ string is smaller with a higher SSO capacity which in many scenarios can overwhelm the code generation. So it's hard to draw an absolute conclusions.
- Iwan-Zotow 2y ago> libc++ string is smaller modern 64bit cpus has no less than 32bytes cacheline
- GuB-42 2y agoSize is very important, and in may experience less memory usage tend to beat using less instructions. So I understand Clang decision to trade size for complexity. Clang developers are not stupid, if they did that instead of copying what GCC or MSVC did (they both predate clang), there is a good reason, and my guess is that it is better aligned with how modern architectures and optimizers work. Anyways, that's a tradeoff, but on a modern high performance computer, intuitively, I would side with clang.
- cozzyd 2y agoOn the other hand, ABI incompatibility has a cost (not that GCC has stayed ABI-compatible with itself...)