-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Impeller] Started using a pool for HostBuffers. #44081
Conversation
@chinmaygarde I'm guessing this isn't exactly how you want things laid out. Let me know where you want me to put stuff. |
@jonahwilliams I made the pool threadsafe and I limited its size to a certain number of bytes (1MB), throwing away any buffer that happens to grow over 512K. I also briefly looked into trying to convert the |
I also punted on using a lockless ring buffer for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this approach looks good to me. We have a similar pattern for recycling objects but it is vulkan specific, and I belive @chinmaygarde wants to hoist this up so we can use it in a non-backend specific manner.
So lets make sure this implementation can converge with the plans for texture recycling.
I'm going to pick up the recycling work after subpasses. So not making any progress on it right now. Let's land this if it LGTY and handle the bigger recycling update later. |
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
19c7a16
to
b24098c
Compare
…131696) flutter/engine@1aadc75...10a1f9c 2023-08-01 30870216+gaaclarke@users.noreply.github.com [Impeller] Started using a pool for HostBuffers. (flutter/engine#44081) 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 jacksongardner@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#131696) flutter/engine@1aadc75...10a1f9c 2023-08-01 30870216+gaaclarke@users.noreply.github.com [Impeller] Started using a pool for HostBuffers. (flutter/engine#44081) 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 jacksongardner@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This removes ~792 MB/s of allocation when scrolling around the Gallery ((358 MB - 226 MB) * 6). ## before <img width="1337" alt="Screenshot 2023-07-27 at 1 48 57 PM" src="https://github.com/flutter/engine/assets/30870216/d320c2da-c333-40b7-9326-c9b69e5ff462"> ## after <img width="1391" alt="Screenshot 2023-07-27 at 1 36 35 PM" src="https://github.com/flutter/engine/assets/30870216/e3314a03-8691-4766-9989-aef112703384"> ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [x] 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 Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat --------- Co-authored-by: Jonah Williams <jonahwilliams@google.com>
This removes ~792 MB/s of allocation when scrolling around the Gallery ((358 MB - 226 MB) * 6).
before
after
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.