3 ms·
> I firmly agree with Rust's choice not to implement the SSO optimisation in the standard library's String type. Out of curiosity, why is that? I don't know m
by rtfeldman 4y ago
> I firmly agree with Rust's choice not to implement the SSO optimisation in the standard library's String type.
Out of curiosity, why is that?
I don't know much about how or why that decision was made, but I'm curious.
- lifthrasiir 4y agoSSO means that pretty every string operation has multiple code paths, which can be highly unpredictable. Basically it is a trade-off between memory usage and performance, and the standard library is not really a good place to make that trade-off. By comparison many C++ codes (still) copy strings all over the place for no good reason, so SSO in the standard library has a much greater appeal.