This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profdata] Rewrite algorithm to reduce profile size limit
Needs ReviewPublic

Authored by huangjd on Jul 19 2023, 7:10 PM.

Details

Summary

Using the redesigned interface to take a range of NameFunctionSamples in
SampleProfileWriter, the performance of the default algorithm to reduce
the profile is greatly improved. Now use binary search to converge faster
since the container is not modified each iteration.

Diff Detail

Event Timeline

huangjd created this revision.Jul 19 2023, 7:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 7:10 PM
huangjd requested review of this revision.Jul 19 2023, 7:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 7:10 PM

Can you add some numbers on the speedup to the patch description? Also how much is profile size reduction wall time as a fraction of the entire time?

Can you add some numbers on the speedup to the patch description? Also how much is profile size reduction wall time as a fraction of the entire time?

Reduce 50 MB compressed extbinary profile to 12 MB, previously takes 1 minute, after refactoring takes 34s.

What do you mean by profile size reduction as a fraction of the entire time?
Profile size reduction is usually done manually to satisfy certain objectives, it is not used automatically by the compiler. However we still want the time spent to be reasonable to the user.