[llvm] [memprof] Omit the key length for the call stack table (PR #89510)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 20 18:41:07 PDT 2024


kazutakahirata wrote:

> Is it worth doing the same for the other EmitKeyDataLength implementations in this file (at least under Version >= 2) since they also appear to be uint64_t?

Yes, we could do the same for other on-disk hash tables used in MemProf.  I like the idea because we get to save the disk space simply by doing less serialization/deserialization rather than relying on some complicated encoding and/or algorithms.   That said, we do have to route versions to these writer/reader traits, and the remaining savings from omitting key length for `IndexedMemProfRecord`  and the key/data lengths for `Frame` are smaller -- 0.27% of the file size.  (The savings will look percentage-wise bigger once we deduplicate `MemoryInfoBlock` also).

I posted this patch first because it's very simple with no need to route versions to the traits.  I'll post follow-up patches if you are open to omitting the key lengths for the other two on-disk hash tables.

https://github.com/llvm/llvm-project/pull/89510


More information about the llvm-commits mailing list