[all-commits] [llvm/llvm-project] f367ea: [memprof] Add accessors to Frame::SymbolName (#94085)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sun Jun 2 22:59:42 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f367eaa4647404414ab256d2ac3c4d4f6c6d1363
      https://github.com/llvm/llvm-project/commit/f367eaa4647404414ab256d2ac3c4d4f6c6d1363
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-06-02 (Sun, 02 Jun 2024)

  Changed paths:
    M llvm/include/llvm/ProfileData/MemProf.h

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list