about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/allocator.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-03 00:24:14 +0000
committerbors <bors@rust-lang.org>2025-05-03 00:24:14 +0000
commit2ad5f8607d0e192b60b130e5cc416b477b351c18 (patch)
tree78b2124065aff2dd0e8aa6ce263c6f736b1724ea /compiler/rustc_codegen_llvm/src/allocator.rs
parent2d5ffc513f1c56b7bc95bacb2519705096e8cc2b (diff)
parent578ea26b8fdf67c830b8991051c1840ff0846e33 (diff)
downloadrust-2ad5f8607d0e192b60b130e5cc416b477b351c18.tar.gz
rust-2ad5f8607d0e192b60b130e5cc416b477b351c18.zip
Auto merge of #140442 - osiewicz:collector-walk-less-fine-grained-locking, r=wesleywiser
mono collector: Reduce # of locking while walking the graph

While profiling Zed's dev build I've noticed that while most of the time `upstream_monomorphizations` takes a lot of time in monomorpization_collector, in some cases (e.g. build of `editor` itself) the rest of monomorphization_collector_graph_walk dominates it. Most of the time is spent in collect_items_rec.

This PR aims to reduce the number of locks taking place; instead of locking output MonoItems once per children of current node, we do so once per *current node*. We also get to reuse locks for mentioned and used items. While this commit does not reduce Wall time of Zed's build, it does shave off CPU time (measured with `cargo build -j1`) from 48s to 47s. I've also tested it with parallel frontend against Zed and ripgrep and found no regressions.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/allocator.rs')
0 files changed, 0 insertions, 0 deletions