3 ms·
If it's using string optimizations due to short strings, you're cutting allocations in almost half I believe, as well as putting said strings on the stack inste
by runevault 6y ago
If it's using string optimizations due to short strings, you're cutting allocations in almost half I believe, as well as putting said strings on the stack instead of the heap which will give... significant performance gains. Short strings in the C++ standard library can be crazy fast.
- plorkyeran 6y agoIt doesn't merely cut allocations in half; it cuts them to zero.
- runevault 6y agoDo you mean allocations as in heap? If so yeah, I guess I should have stated it better as it still needs to put space on the stack for the short string.
- josefx 6y agoThe stack space for the whole function call is allocated in one step. You only get individual allocations when you are messing around with variable length arrays or alloca.