This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/rustc_query_system/src/dep_graph Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1212//! node and edge count are stored at the end of the file, all the arrays can be
1313//! pre-allocated with the right length.
1414//!
15- //! The encoding of the de-pgraph is generally designed around the fact that fixed-size
15+ //! The encoding of the dep-graph is generally designed around the fact that fixed-size
1616//! reads of encoded data are generally faster than variable-sized reads. Ergo we adopt
1717//! essentially the same varint encoding scheme used in the rmeta format; the edge lists
1818//! for each node on the graph store a 2-bit integer which is the number of bytes per edge
3434//! [`DepKind`], number of edges, and bytes per edge are all bit-packed together, if they fit.
3535//! If the number of edges in this node does not fit in the bits available in the header, we
3636//! store it directly after the header with leb128.
37+ //!
38+ //! Dep-graph indices are bulk allocated to threads inside `LocalEncoderState`. Having threads
39+ //! own these indices helps avoid races when they are conditionally used when marking nodes green.
40+ //! It also reduces congestion on the shared index count.
3741
3842use std:: cell:: RefCell ;
3943use std:: cmp:: max;
You can’t perform that action at this time.
0 commit comments