[memprof] Add accessors to Frame::SymbolName (#94085)
This patch adds accessors to Frame::SymbolName so that we can change the underlying type of SymbolName without affecting downstream users once they switch to the new accessors. Note that SymbolName is only used for debugging. Changing the type of SymbolName from std::optional<std::string> to std::unique_ptr<std::string> cuts down sizeof(Frame) by half -- from 64 bytes to 32 bytes. (std::optional<T> sets aside the storage in case T is instantiated.) During deserialization, the memory usage is dominated by Frames. Shrinking the type cuts down the memory usage and deserialization time nearly by half.
parent
718331f5
Please register or sign in to comment