4 ms·
Depending on your usage it is not necessarily less optimal either. You never need to walk the string to find the \0 byte. e.g. for strlen. For short strings n
by pasc1878 2y ago
Depending on your usage it is not necessarily less optimal either.
You never need to walk the string to find the \0 byte. e.g. for strlen.
For short strings no heap memory needs to be allocated or deallocated.
- account42 2y agoIt's really too bad though that the short string optimization capacity is neither standardized nor user-controlled.