[PATCH] D94110: [CSSPGO][llvm-profgen] Aggregate samples on call frame trie to speed up profile generation

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 12:22:53 PST 2021


wlei added a comment.

> I think the aggregation is still worth keeping as it's probably still cheaper than trie with hashing. But we will know for sure through experiments.



In D94110#2514693 <https://reviews.llvm.org/D94110#2514693>, @wenlei wrote:

> With the latest, do you see similar speed up for probe profile and dwarf profile?

have implemented the global trie for the virtual unwinder part and done the evaluation over the LBR trie against baseline and global trie on probe profile. See the chart below, here only use `gobmk` and `sjeng` because other benchmarks's run time of virtual unwinder are very small(less than 1s).

The virtual unwinding time(s):

|       | No-Trie | LBR-Trie | Global-Trie |
| ----- | ------- | -------- | ----------- |
| gobmk | 8.31    | 3.6      | 4.11        |
| sjeng | 46.82   | 19.15    | 24.91       |
|

Speed up:

|       | LBR-Trie vs No-Trie | Global-Trie vs No-Trie | Global-Trie vs LBR-Trie |
| ----- | ------------------- | ---------------------- | ----------------------- |
| gobmk | 2.3                 | 2.02                   | 0.88                    |
| sjeng | 2.44                | 1.87                   | 0.77                    |
|

Sum-up:

- LBR-Trie and Global-Trie can have about 2x speed-up over the baseline
- Global-Trie have slight regression(about 10%) against LBR-Trie as we discussed this might be caused by hash overhead.
- Didn't see the similar speed-up as our internal prototype, I guess it's because of the refinement we did in the previous patches like removing the redundant string concatenation and reversal, switching to use probe based key.

Beside the time, LBR-trie seems good for the readability but Global-Trie can be easy to detect shared context. Haven't tried to defer the context generation(should have more speed-up for Global-Trie) and detect shared context, will try it.

CC: @wmi  @hoy


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94110/new/

https://reviews.llvm.org/D94110



More information about the llvm-commits mailing list