Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] ProjectBuilder: Build projects concurrently if possible #626

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Jun 22, 2023

Based on the required dependencies information provided by the tasks, determine which projects need to be build in sequence and which can be build in parallel.

This can lead to a significantly faster build in some cases, depending on the number of dependencies and which tasks need to be executed. A major drawback is currently that it becomes unclear which log messages are related to which project.

Benchmarks

Based on 1f5293f

openui5-sample-app (6240774)

Command Mean [s] Min [s] Max [s] Relative
ui5 build -a 16.999 ± 0.719 16.224 18.231 Baseline
UI5_BUILD_CONCURRENT=X ui5 build -a 16.405 ± 0.513 15.766 17.240 -3.5%

About 60 UI5 Framework Libraries (full build)

Command Mean [s] Min [s] Max [s] Relative
ui5 build -a 107.430 ± 1.160 105.863 109.337 Baseline
UI5_BUILD_CONCURRENT=X ui5 build -a 91.234 ± 4.971 86.525 98.451 -15.1%

About 60 UI5 Framework Libraries (reduced build)

Only executing tasks generateLibraryPreload, generateBundle, generateComponentPreload, generateLibraryManifest and minify.

Command Mean [s] Min [s] Max [s] Relative
ui5 build -a --exclude-task "*" --include-task generateLibraryPreload generateBundle generateComponentPreload generateLibraryManifest minify 48.753 ± 2.035 46.166 51.300 Baseline
UI5_BUILD_CONCURRENT=X ui5 build -a --exclude-task "*" --include-task generateLibraryPreload generateBundle generateComponentPreload generateLibraryManifest minify 33.683 ± 0.802 32.713 34.906 -30,9%

Based on the required dependencies information provided by the tasks,
determine which projects need to be build in sequence and which can be
build in parallel.

This can lead to a significantly faster build in some cases, depending
on the number of dependencies and which tasks need to be executed.
@RandomByte RandomByte marked this pull request as draft June 22, 2023 21:41
@RandomByte RandomByte changed the title [POC] ProjectBuilder: Build projects in parallel if possible [POC] ProjectBuilder: Build projects concurrently if possible Jun 23, 2023
With this change the build order is no longer pre-determined but
dynamic. Once all dependencies of a project (as defined by the task
runner) are built, the project is built.

Renamed env variable UI5_BUILD_PARALLEL to UI5_BUILD_CONCURRENT
@@ -121,6 +121,7 @@ class ProjectBuilder {
* @param {object} parameters Parameters
* @param {string} parameters.destPath Target path
* @param {boolean} [parameters.cleanDest=false] Decides whether project should clean the target path before build
* @param {boolean} [parameters.concurrentBuild=false] Whether to build projects concurrently if possible
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: we should document well what it means "if possible"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants