[PATCH] D38266: Parallelize string merging.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 15:14:42 PDT 2017


> +  // Parallelism. Changing this number causes benign changes in the
> +  // order of output section pieces. For build reproducibility, we
> +  // always use the same number.
> +  static constexpr size_t NumShards = 8;
> +
> +  std::vector<llvm::StringTableBuilder> Shards;
> +  size_t ShardOffsets[NumShards];

ShardOffsets is only used in one function, no?


> +// Even though skipping unwanted section pieces is much faster than putting
> +// them into hash tables, the cost of doing it is not free. Therefore,
> +// this function is slower than a single-threaded version if we have few
> +// number of cores. I think it's acceptable because it looks like dual core
> +// is a break-even for this function.

Make the comment impersonal.

I will do a benchmark run and report.

Cheers,
Rafael


More information about the llvm-commits mailing list