[PATCH] D38266: Parallelize string merging.

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


Rafael Avila de Espindola <rafael.espindola at gmail.com> writes:

>> +  // 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;
>
> One idea that might allow using a variable number of shards:
>
> Sort the strings once they are know to be unique. The sort order can be
> based on the hash and look at the string itself only if two hashes are
> identical, so it shouldn't be too slow.

In fact, we could use the N most significant bits of the hash to do the
sharding. That way we only need to sort inside each shard.

Cheers,
Rafael


More information about the llvm-commits mailing list