This is an archive of the discontinued LLVM Phabricator instance.

[profile] Support merge pool size >= 10
ClosedPublic

Authored by MaskRay on Dec 28 2019, 9:37 PM.

Details

Summary

The executable acquires an advisory record lock (fcntl(fd, F_SETLKW, *)) on a profile file.
Merge pool size >= 10 may be beneficial when the concurrency is large.

Also fix a small problem about snprintf. It can cause the filename to be truncated after %m.

Event Timeline

MaskRay created this revision.Dec 28 2019, 9:37 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 28 2019, 9:37 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
MaskRay updated this revision to Diff 235499.Dec 28 2019, 11:18 PM
MaskRay edited the summary of this revision. (Show Details)

Fix an existing problem regarding snprintf

vsk added a comment.Jan 6 2020, 11:02 AM

What kind of performance improvement were you able to measure for your workload with n >= 10? What was the impact on profile size?

davidxl accepted this revision.Jan 6 2020, 11:25 AM

lgtm

This revision is now accepted and ready to land.Jan 6 2020, 11:25 AM
In D71970#1806455, @vsk wrote:

What kind of performance improvement were you able to measure for your workload with n >= 10? What was the impact on profile size?

It has been a while since I measured the difference. If I use LLVM_PROFILE_FILE=...%4m for llc and LLVM_PROFILE_FILE=/dev/null for other tools, %4m vs %9m has significant performance improvement testing test/CodeGen/X86, maybe 30% (I may misremember the number) or something. %9m vs %20m has insignificant difference. If my machine has more cores or if I choose a better benchmark, I may see a difference :)

This revision was automatically updated to reflect the committed changes.