Parallelizing rustc using Rayon

Seems like @Zoxc has already started in on this! :guitar: :dancer: :guitar: :man_cartwheeling: :guitar:

2 Likes

In the above discussion, you talk about:

  • B – Depends on --> A – Depends on --> C

It is confusing to read about because, well, “A, B, C”. It would be easier to read the explanation if you said:

  • A – Depended on by --> B – Depended on by --> C

And update your explanation of A, B, C to reflect that dependency.

What happened here anyway? I recall a floury of activity and the everything seemed to go silent…

2 Likes

Here is a status update for you. This is now implemented in rustc in a more limited form which blocks when a query need to wait on another query on another thread instead of using fibers. The performance of that approach is still good, here is a recent benchmark. Incremental compilation does take a performance hit and could use further optimization for parallel execution. There’s still room for further parallelization too, in particular LLVM IR generation is not yet parallel, which my experimental branch had.

You can test out this by building rustc with [rust] experimental-parallel-queries = true in config.toml. You can then adjust the size of the thread pool used with -Z query-threads=n and it currently defaults to 1.

12 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.