dart-lang / dart-lang/native

[native_assets_builder] Compile and run hooks in parallel

Open
#1,288 1 comment 0 reactions 0 assignees View on GitHub
P2 package:hooks_runner
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

We should consider:

* compiling hooks in parallel
* running hooks in parallel

> We should be really optimizing for compile times in `dart build ` / `flutter build`, e.g. if the package graphs depth is 30 and all of them use hooks, saving a single second (e.g. via parallel compile of hooks to kernel) would save half a minute for a developer.

_Originally posted by @mkustermann in https://github.com/dart-lang/native/issues/1256#issuecomment-2213676077_

The initial prototype was running hooks in parallel, but it locked up someones machine (back then compiling for all targets concurrently). So maybe we should consider limiting the parallelism.

If we intend parallelism to the number of cores on the machine, then we should consider that hooks might use more than one core. Some build systems allow cooperative scheduling:

* https://www.gnu.org/software/make/manual/html_node/Job-Slots.html
* https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

More conservatively, we could consider only compiling hooks in parallel.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.