This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] use fewer threads for shader bootstrap workers on low core machines.#50726
Merged
auto-submit[bot] merged 4 commits intoflutter:mainfrom Feb 16, 2024
Merged
Conversation
gaaclarke
approved these changes
Feb 16, 2024
Member
gaaclarke
left a comment
There was a problem hiding this comment.
lgtm, we really should have a clamp somewheres
| size_t ChooseThreadCountForWorkers(size_t hardware_concurrency) { | ||
| // Never create more than 4 worker threads. Attempt to use up to | ||
| // half of the available concurrency. | ||
| return std::min(4ull, std::max(hardware_concurrency / 2ull, 1ull)); |
Member
There was a problem hiding this comment.
nit: This would be much easier to parse with a clamp function
return clamp(hardware_concurrency / 2ull, /*min=*/1ull, /*max=*/4ull);
Contributor
Author
Member
There was a problem hiding this comment.
oh cool, I didn't know they have one in std. I think the linter is going to complain that the arg names should be lo and hi... yea, lo and hi 🙄
Contributor
Author
There was a problem hiding this comment.
they charge per letter
gaaclarke
reviewed
Feb 16, 2024
| /// Choose the number of worker threads the context_vk will create. | ||
| /// | ||
| /// Visible for testing. | ||
| size_t ChooseThreadCountForWorkers(size_t hardware_concurrency); |
Member
There was a problem hiding this comment.
Oh, this should be static too.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 16, 2024
…low core machines. (flutter/engine#50726)
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Feb 16, 2024
flutter/engine@5fd5ccf...13dc857 2024-02-16 [email protected] [Impeller] use fewer threads for shader bootstrap workers on low core machines. (flutter/engine#50726) 2024-02-16 [email protected] Fix implementation imports outside of lib (flutter/engine#50727) 2024-02-16 [email protected] Roll Skia from 87e8e9c8f42b to 2919d86cad12 (8 revisions) (flutter/engine#50723) 2024-02-16 [email protected] Roll Dart SDK from 947c8c487e28 to 21b9ee6f0a52 (2 revisions) (flutter/engine#50717) 2024-02-16 [email protected] Roll Skia from c89a4cd72308 to 87e8e9c8f42b (3 revisions) (flutter/engine#50716) 2024-02-16 [email protected] Roll Fuchsia Linux SDK from fXqP_YC4zTp9G2hA5... to YN5KCfom7Ax0Z69s_... (flutter/engine#50719) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from fXqP_YC4zTp9 to YN5KCfom7Ax0 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of flutter/flutter#143540
We were using 4 threads for shader bootstrap on a device with only 4 cores. Using fewer threads seems to improve performance on fewer core machines.