This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profdata] Condense string allocations for MD5 function names
AbandonedPublic

Authored by huangjd on Apr 27 2023, 1:08 AM.

Details

Summary

Allocate a big buffer enough to hold all MD5 strings, instead of allocating it on heap one by one.
Also materialize all MD5 strings if the full profile is being read since all these strings are generated anyways.

Improved around 3% speed on loading an ExtBinary profile with 1GB total size/10 million names.

This refactoring takes precendence over the refactoring of using MD5 as key

Diff Detail

Event Timeline

huangjd created this revision.Apr 27 2023, 1:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 1:08 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
huangjd requested review of this revision.Apr 27 2023, 1:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 1:08 AM
davidxl added inline comments.Apr 27 2023, 9:57 AM
llvm/include/llvm/ProfileData/SampleProfReader.h
662

Can we reduce the size using hex encoding?

huangjd abandoned this revision.Sep 14 2023, 2:56 PM