[PATCH] D22438: [llvm-profdata] Speed up merging by using a thread pool

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 16 15:32:19 PDT 2016


silvas added a comment.

The way you arrived at sqrt(N) seems sketchy to me.
Assuming infinite parallelism, the first step performs N/2 merges and then you recurse on the N/2 merged profiles:

`numMerges(N) = N/2 + numMerges(N/2)`
`numSerialMerges(N) = 1 + numSerialMerges(N/2)`

Which must work out to something like log(N) serial merges. I.e. a binary reduction.


https://reviews.llvm.org/D22438





More information about the llvm-commits mailing list