Skip to content

Commit

Permalink
Auto merge of #16162 - sanjaiyan-dev:sanjaiyan-async-concurrent, r=ln…
Browse files Browse the repository at this point in the history
…icola

minor: Optimizing Performance with `Promise.all` 🏎

Hello,

This pull request introduces a modest performance improvement by executing asynchronous tasks using `Promise.all`, thereby enhancing the efficient utilization of hardware resources.

Thank you for considering this enhancement.

Ref-: rust-lang/rust#119108
  • Loading branch information
bors committed Dec 19, 2023
2 parents 37b0019 + f587b54 commit 831d0e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions editors/code/src/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ async function getDebugConfiguration(
let sourceFileMap = debugOptions.sourceFileMap;
if (sourceFileMap === "auto") {
// let's try to use the default toolchain
const commitHash = await getRustcId(wsFolder);
const sysroot = await getSysroot(wsFolder);
const [commitHash, sysroot] = await Promise.all([
getRustcId(wsFolder),
getSysroot(wsFolder),
]);
const rustlib = path.normalize(sysroot + "/lib/rustlib/src/rust");
sourceFileMap = {};
sourceFileMap[`/rustc/${commitHash}/`] = rustlib;
Expand Down

0 comments on commit 831d0e0

Please sign in to comment.