Skip to content

Commit 7994aca

Browse files
stepanchegfacebook-github-bot
authored andcommitted
check_starlark_stack_size and resolve_package_listing concurrently
Summary: This should have no effect practically because `check_starlark_stack_size` is cache hit except first time. But I need to fetch profile mode there, and that should be done concurrently with `resolve_package_listing`, so I'll add another `compute` branch. Reviewed By: JakobDegen Differential Revision: D58789803 fbshipit-source-id: 6b5d0e77390a49446d314790b2c38544bbbd6b39
1 parent 3059b49 commit 7994aca

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

app/buck2_interpreter_for_build/src/interpreter/dice_calculation_delegate.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,15 @@ impl<'c, 'd: 'c> DiceCalculationDelegate<'c, 'd> {
414414
}
415415

416416
async fn resolve_package_listing(
417-
&mut self,
417+
ctx: &mut DiceComputations<'_>,
418418
package: PackageLabel,
419419
) -> anyhow::Result<PackageListing> {
420420
span_async(
421421
buck2_data::LoadPackageStart {
422422
path: package.as_cell_path().to_string(),
423423
},
424424
async {
425-
let result = DicePackageListingResolver(self.ctx)
425+
let result = DicePackageListingResolver(ctx)
426426
.resolve_package_listing(package.dupe())
427427
.await;
428428
(
@@ -441,9 +441,13 @@ impl<'c, 'd: 'c> DiceCalculationDelegate<'c, 'd> {
441441
package: PackageLabel,
442442
profiler_instrumentation: &mut StarlarkProfilerOpt<'_>,
443443
) -> buck2_error::Result<Arc<EvaluationResult>> {
444-
check_starlark_stack_size(self.ctx).await?;
445-
446-
let listing = self.resolve_package_listing(package.dupe()).await?;
444+
let ((), listing) = self
445+
.ctx
446+
.try_compute2(
447+
|ctx| check_starlark_stack_size(ctx).boxed(),
448+
|ctx| Self::resolve_package_listing(ctx, package.dupe()).boxed(),
449+
)
450+
.await?;
447451

448452
let build_file_path = BuildFilePath::new(package.dupe(), listing.buildfile().to_owned());
449453
let (ast, deps) = self

0 commit comments

Comments
 (0)