Query Parallelization Tracking Issue #48685
Comments
I'm trying to identify the blocking issues for a minimal but correct version of parallel queries. Ideally we would solve all of them over the next few weeks So far I've found:
There are a few things that also need to be solved medium term, but they are not blocking yet:
@Zoxc, @nikomatsakis, @oli-obk, @eddyb: I'm sure this list does not cover all blockers. Let me know what I forgot |
@michaelwoerister We also have to make queries work on a Rayon thread-pool |
What exactly does this involve? |
@michaelwoerister We have to make waiting on already executing queries block and also detect and recover from query cycles |
Ah, right. The blocking should be easy enough. I have not thought in detail about cycle detection and recovery though. |
Both of these should be implemented by #50699, right? |
@michaelwoerister Yeah. |
A rustc HEAD compiled with |
ci: Conditionally build parallel compiler on `try` This commit configures Travis/AppVeyor to conditionally compile parallel compilers on `@bors: try`. This is an experiment currently to see how this plays out, but the intention is that if the commit message contains the term "parallel-compiler" then when `@bors: try` is issued it will perform differently than the try branch does today, building three compilers: Linux, macOS, and Windows. We currently have no `try` builders for macOS or Windows due to typical capacity issues, so it's intended that this is only very sparingly used from time to time when necessary. [parallel-compiler] cc #48685, tracking issue for parallel compilation
ci: Conditionally build parallel compiler on `try` This commit configures Travis/AppVeyor to conditionally compile parallel compilers on `@bors: try`. This is an experiment currently to see how this plays out, but the intention is that if the commit message contains the term "parallel\-compiler" then when `@bors: try` is issued it will perform differently than the try branch does today, building three compilers: Linux, macOS, and Windows. We currently have no `try` builders for macOS or Windows due to typical capacity issues, so it's intended that this is only very sparingly used from time to time when necessary. cc #48685, tracking issue for parallel compilation
ci: Conditionally build parallel compiler on `try` This commit configures Travis/AppVeyor to conditionally compile parallel compilers on `@bors: try`. This is an experiment currently to see how this plays out, but the intention is that if the commit message contains the term "parallel\-compiler" then when `@bors: try` is issued it will perform differently than the try branch does today, building three compilers: Linux, macOS, and Windows. We currently have no `try` builders for macOS or Windows due to typical capacity issues, so it's intended that this is only very sparingly used from time to time when necessary. cc #48685, tracking issue for parallel compilation
ci: Conditionally build parallel compiler on `try` This commit configures Travis/AppVeyor to conditionally compile parallel compilers on `@bors: try`. This is an experiment currently to see how this plays out, but the intention is that if the commit message contains the term "parallel\-compiler" then when `@bors: try` is issued it will perform differently than the try branch does today, building three compilers: Linux, macOS, and Windows. We currently have no `try` builders for macOS or Windows due to typical capacity issues, so it's intended that this is only very sparingly used from time to time when necessary. cc #48685, tracking issue for parallel compilation
This issue is a sub-issue of #48547: it tracks the in-progress effort to parallelize rustc across queries. This work is being spearheaded by @Zoxc.
Goals
Allow rustc to execute queries in parallel with one another. Enable the use of rayon or other tools for intra-query parallelization as well. See this internals thread for more information.
Overview of the plan
RefCell
usage withMutex
Pending refactorings
TransitiveRelation
doesn't really need to use aRefCell
. In the future, it won't even be shared, but regardless the caching scheme could be reworked to avoidRefCell
.mk_attr_id
use a scoped thread local or make it part ofParseSess
GlobalCtxt::layout_depth
so it does not need global mutable state (#49735)GlobalCtxt.rcache
,OnDiskCache.file_index_to_file
andOnDiskCache.synthetic_expansion_infos
are faster as thread-localsSession.lint_store
andSession.buffered_lints
Completed refactorings
QueryJob
field. (implemented in #49732)libproc_macro
for issues, Find out which types should beSend
,Sync
. Deal withDeref
impls forSymbol
. (#49219)CStore::next_crate_num
FileMap.lines
,FileMap.multibyte_chars
, andFileMap.non_narrow_chars
immutable (implemented in #50997)DepGraph.try_mark_green
DepGraphData.previous_work_products
so it becomes immutable (#50501) (implemented in #50524)DepGraphData.work_products
by threaded the value throughsave_trans_partition() -> copy_module_artifacts_into_incr_comp_cache() -> OngoingCrateTranslation::join()
(#50500) (implemented in #50885The text was updated successfully, but these errors were encountered: