This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] make host buffer state internally ref counted.#48303
Merged
auto-submit[bot] merged 2 commits intoflutter:mainfrom Nov 22, 2023
Merged
[Impeller] make host buffer state internally ref counted.#48303auto-submit[bot] merged 2 commits intoflutter:mainfrom
auto-submit[bot] merged 2 commits intoflutter:mainfrom
Conversation
Contributor
Author
bdero
approved these changes
Nov 22, 2023
Contributor
bdero
left a comment
There was a problem hiding this comment.
LGTM modulo missing symbol
impeller/core/host_buffer.h
Outdated
| size_t generation_ = 1u; | ||
| std::string label_; | ||
| class HostBufferState : public Buffer, public Allocation { | ||
| public: |
Contributor
There was a problem hiding this comment.
Nit: mark as struct and remove access modifier?
impeller/core/host_buffer.h
Outdated
|
|
||
| void Reset(); | ||
|
|
||
| size_t GetSize() const; |
Contributor
There was a problem hiding this comment.
I think the definition is missing for this symbol and it's not being used by anything.
| //---------------------------------------------------------------------------- | ||
| /// @brief Returns the size of the HostBuffer in memory in bytes. | ||
| /// @brief Returns the capacity of the HostBuffer in memory in bytes. | ||
| size_t GetSize() const; |
Contributor
There was a problem hiding this comment.
(Just a drive-by comment, but this name is weird for what it is. It looks like the functionality is the same as it was before, though.)
Contributor
Author
There was a problem hiding this comment.
Yeah, should be called capacity. I changed the doc comment so it was approximately accurate...
dnfield
approved these changes
Nov 22, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 22, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 22, 2023
fluttermirroringbot
pushed a commit
to flutter/flutter
that referenced
this pull request
Nov 22, 2023
flutter/engine@1ae1d53...dda2499 2023-11-22 [email protected] Roll Skia from cebd44423589 to 143b6b5b91a5 (1 revision) (flutter/engine#48305) 2023-11-22 [email protected] Roll Skia from 23b9316efd20 to cebd44423589 (1 revision) (flutter/engine#48304) 2023-11-22 [email protected] [Impeller] make host buffer state internally ref counted. (flutter/engine#48303) 2023-11-22 [email protected] Roll Skia from b6f33389cefa to 23b9316efd20 (2 revisions) (flutter/engine#48302) 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
caseycrogers
pushed a commit
to caseycrogers/flutter
that referenced
this pull request
Dec 29, 2023
…8872) flutter/engine@1ae1d53...dda2499 2023-11-22 [email protected] Roll Skia from cebd44423589 to 143b6b5b91a5 (1 revision) (flutter/engine#48305) 2023-11-22 [email protected] Roll Skia from 23b9316efd20 to cebd44423589 (1 revision) (flutter/engine#48304) 2023-11-22 [email protected] [Impeller] make host buffer state internally ref counted. (flutter/engine#48303) 2023-11-22 [email protected] Roll Skia from b6f33389cefa to 23b9316efd20 (2 revisions) (flutter/engine#48302) 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.

std::shared_from_this is actually incredibly slow, and dominates the cost of host buffer allocation at 20x more expensive than the memcpy. We can remove the usage of shared_from_this by making an internal class hold the actual allocation/buffer state instead.
Before
146 ms / 647ms = ~20%
After
33 ms / 540 ms = ~6%