Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

gaaclarke
Copy link
Member

A minor optimization that places default pipelines that are synchronized upon in the InitializeCommonlyUsedShadersIfNeeded first in the queue to be created.

issue: flutter/flutter#145843

sequence diagram of the synchronization:
pipeline-seq

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@gaaclarke gaaclarke changed the title [Impeller] sorted commonly used default shaders first [Impeller] sorted commonly used default pipelines first Apr 18, 2024
@gaaclarke
Copy link
Member Author

I think we can do more to fix the linked issue. This was just an easy tweak in the meantime while we look into more invasive solutions.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM, good idea!

@chinmaygarde
Copy link
Member

Its hard to gauge if this just kicks the can down the road and blocks on the first frame instead. Also, and though I have no qualms about landing this as-is, I bet this is hard to tune and harder still to test.

How about about giving these the compilation jobs to the job scheduler that maintains a std::priority_queue of procs ordered by the last time they were requested and pops from that queue to the concurrent task runner. The get of the future (if no already fulfilled) can bump the place of the proc in the priority queue. That way, the jobs that are most eagerly needed will skip to the front of the job queue automatically.

@jonahwilliams
Copy link
Contributor

I don't know if I would invest that much effort in this kind of change. We may need to completely rethink how we bootstrap pipelines to be fast on Vulkan

@chinmaygarde
Copy link
Member

Yeah, and the 2s was on old devices too and only on first launch. If this is the end of the line on investigating perf wins in this area, then great. If we keep spending time tinkering on this order, perhaps our time is better spent bringing down the counts, etc..

@jonahwilliams
Copy link
Contributor

I think its still like 500ms on a Pixel 4/5 :(

@gaaclarke
Copy link
Member Author

Yea, I think we can do more. I'm actively looking into it. This is just an easy tweak that relies on the worker queue being fifo.

@gaaclarke gaaclarke merged commit eb027b8 into flutter:main Apr 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 18, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 18, 2024
…147017)

flutter/engine@13a6ce4...61bf47d

2024-04-18 [email protected] Roll Dart SDK from 8d834bbb2163 to 62b85ea79bce (1 revision) (flutter/engine#52236)
2024-04-18 [email protected] Roll Skia from 1af1e478ef85 to edece87ce734 (5 revisions) (flutter/engine#52233)
2024-04-18 [email protected] Suppress in-actionable warnings in the iOS profiler. (flutter/engine#52227)
2024-04-18 [email protected] [Impeller] sorted commonly used default pipelines first (flutter/engine#52231)

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
gilnobrega pushed a commit to gilnobrega/flutter that referenced this pull request Apr 22, 2024
…lutter#147017)

flutter/engine@13a6ce4...61bf47d

2024-04-18 [email protected] Roll Dart SDK from 8d834bbb2163 to 62b85ea79bce (1 revision) (flutter/engine#52236)
2024-04-18 [email protected] Roll Skia from 1af1e478ef85 to edece87ce734 (5 revisions) (flutter/engine#52233)
2024-04-18 [email protected] Suppress in-actionable warnings in the iOS profiler. (flutter/engine#52227)
2024-04-18 [email protected] [Impeller] sorted commonly used default pipelines first (flutter/engine#52231)

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants