Unverified Commit 20f39bf4 authored by Eric's avatar Eric Committed by GitHub
Browse files

Lower std::string's alignment requirement from 16 to 8. (#68807)

This allows smaller allocations to occur, closer to the actual
std::string's required size. This is particularly effective in
decreasing the allocation size upon initial construction (where
__recommend is called to determine the size).

Although the memory savings per-string are never more than 8 bytes per
string initially, this quickly adds up. And has lead to not insigficant
memory savings at Google.

Unfortunately, this change is ABI breaking because it changes the value
returned by max_size. So it has to be guarded.
parent 160e8eb4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment