Skip to content

[RFC] 0014 Task Workers#897

Open
RandomByte wants to merge 14 commits into
mainfrom
rfc-task-workers
Open

[RFC] 0014 Task Workers#897
RandomByte wants to merge 14 commits into
mainfrom
rfc-task-workers

Conversation

@RandomByte

@RandomByte RandomByte commented Nov 10, 2023

Copy link
Copy Markdown
Member

Concept for a new API provided to UI5 Tooling build tasks, enabling easy use of Node.js Worker Threads to execute CPU intensive operations outside of the main thread.

View rendered version

PoC: SAP/ui5-builder#955
JIRA: CPOUI5FOUNDATION-751

@RandomByte RandomByte changed the title Add RFC0014: Task Workers [RFC] 0014 Task Workers Nov 10, 2023
@flovogt flovogt added the RFC Request for Comment (pull request) label Nov 22, 2023
RandomByte added a commit to SAP/ui5-project that referenced this pull request Nov 26, 2023
RandomByte added a commit to SAP/ui5-builder that referenced this pull request Nov 26, 2023
@RandomByte RandomByte marked this pull request as ready for review November 27, 2023 13:37
Comment thread rfcs/0014-task-workers.md Outdated
path: lib/tasks/piProcessor.js
```

**TODO:** Decide on configuration style. Option 1 does not allow for introducing additional per-processor configuration in the future (e.g. max CPU threads, priority, etc.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I find option 3 the most consistent one, as it has a very similar structure as the task itself, and order does not matter (right?), so there's no reason for option 2.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree and updated that part

Comment thread rfcs/0014-task-workers.md Outdated
d3xter666 pushed a commit that referenced this pull request Sep 24, 2025
* [DEPENDENCY] Bump rimraf from 4.4.1 to 5.0.0

Bumps [rimraf](https://github.com/isaacs/rimraf) from 4.4.1 to 5.0.0.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](isaacs/rimraf@v4.4.1...v5.0.0)

---
updated-dependencies:
- dependency-name: rimraf
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* [INTERNAL] rimraf: Migrate to named import

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Florian Vogt <florian.vogt@sap.com>
@RandomByte RandomByte requested review from a team and removed request for a team July 10, 2026 07:30
Comment thread rfcs/0014-task-workers.md

* A task processor is assumed to utilize a single CPU thread by 90-100%
* A task processor is assumed to execute little to no I/O operations
* A task processor is assumed to make little use of UI5 Tooling modules other than those provided directly to the task processor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would go even stricter on this one as the processor (eventually) runs in a thread and it must be totally decoupled from anything else that is not provided as an argument. It's just for the simple reason that even if it tries, it cannot simply access the resources from the main thread like this

Comment thread rfcs/0014-task-workers.md
#### Input Parameters

* **`resources`**: An array of `@ui5/fs/Resource` provided by the task
* **`options`**: An object provided by the task

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It must be a serializeable object. Otherwise, when we pass this object to the thread, some information from it could be lost. Also, it would be very painful for debugging

Comment thread rfcs/0014-task-workers.md
};
```

Option 1 does not allow for introducing additional per-processor configuration in the future (e.g. max CPU threads, priority, etc.). Option 4 can't make use of the existing schema validation of ui5.yaml-based configuration.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe, I'm missing something, but if we take the PoC with workerpool, then workers configuration must be in a single, central place, but not within the definition of the processor. We create a singleton instance of the workerpool that is then reused accross the modules / tasks and the configuration of that workerpool happens at the first invocation of the instance.

From that point, maybe it's not feasible to provide such flexibility per processor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFC Request for Comment (pull request)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants