[all-commits] [llvm/llvm-project] cc4bed: [CSSPGO] Adjust SampleContextFrameVector to be a s...

Hongtao Yu via All-commits all-commits at lists.llvm.org
Tue Jan 25 21:36:58 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cc4beda039ba5441b76b5b112dd5f69553965186
      https://github.com/llvm/llvm-project/commit/cc4beda039ba5441b76b5b112dd5f69553965186
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2022-01-25 (Tue, 25 Jan 2022)

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

  Log Message:
  -----------
  [CSSPGO] Adjust SampleContextFrameVector to be a shorter SmallVector

It appears that some memory saving can be archived by tweaking the existing `SampleContextFrameVector` setup. Below are memory usage for two benchmarks before and after this change.

1. Medium benchmark:
   - Before:

```
    note: After computeSizeForProfiledFunctions
    note: VM: 12.50 GB   RSS: 11.02 GB
    note: After generateProbeBasedProfile
    note: **VM: 30.56 GB   RSS: 29.08 GB**
    note: After postProcessProfiles
    note: VM: 31.91 GB   RSS: 30.43 GB
```
   - After:

```
    note: After computeSizeForProfiledFunctions
    note: VM: 12.26 GB   RSS: 10.80 GB
    note: After generateProbeBasedProfile
    note: **VM: 28.76 GB   RSS: 27.29 GB**
    note: After postProcessProfiles
    note: VM: 30.12 GB   RSS: 28.66 GB
```

2. Large benchmark:
   - Before:

```
    note: After computeSizeForProfiledFunctions
    note: VM: 106.28 GB   RSS: 91.25 GB
    note: After generateProbeBasedProfile
    note: **VM: 245.19 GB   RSS: 224.30 GB**
    note: After postProcessProfiles
    note: VM: 254.96 GB   RSS: 221.58 GB
```

   - After:

```
    note: After computeSizeForProfiledFunctions
    note: VM: 105.95 GB   RSS: 91.04 GB
    note: After generateProbeBasedProfile
    note: VM: **234.29 GB   RSS: 215.39 GB**
    note: After postProcessProfiles
    note: VM: 244.03 GB   RSS: 213.45 GB
```

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D118203




More information about the All-commits mailing list