Optimize: Only call LazyJobserverClient::new when necessary

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2024-11-06 12:11:50 +11:00 committed by GitHub
parent 040068864c
commit 9c20b3c0ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,9 +12,6 @@ use crate::{
};
pub fn do_main() -> impl Termination {
// This must be the very first thing to happen
let jobserver_client = LazyJobserverClient::new();
let (args, cli_overrides) = args::parse();
if args.version {
@ -54,6 +51,8 @@ rustc-llvm-version: {rustc_llvm_version}"#
let start = Instant::now();
let jobserver_client = LazyJobserverClient::new();
let result =
run_tokio_main(|| entry::install_crates(args, cli_overrides, jobserver_client));