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

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Oct 26, 2024

By passing the shared_ptrs to TrackedObjectsVK by value, we will always require at least a decrement of the shared_ptr count, and possibly an increment too.

Since for most cases the tracked object has already been tracked, passing by const ref results in no increment or decrement.

Ignoring the time value, since this is a flamegraph, we can see almost all time spent tracking is spent on shared_ptr decrement:

image

@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, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

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. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

return;
}
tracked_objects_.emplace_back(std::move(object));
tracked_objects_.emplace_back(object);
Copy link
Member

Choose a reason for hiding this comment

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

This is incrementing now. The thesis is that this increment matches the one we are replacing when we grab a const ref and in the case where we leave early we avoid the increment altogether? SGTM. I wish we had settings on that required an explicit copy here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, though I found from tracing that we still have multiple share_ptr decrements per draw because the buffer_view emplacement also does a move still. I will send a separate patch for that

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 28, 2024
@auto-submit auto-submit bot merged commit 23b2c6d into flutter:main Oct 28, 2024
28 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 28, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 28, 2024
…157736)

flutter/engine@bf5bfee...23b2c6d

2024-10-28 [email protected] [Impeller] dont increment shared_ptr when tracked object is already tracked. (flutter/engine#56153)
2024-10-28 [email protected] Roll Dart SDK from a75848f92210 to 69b50768d733 (2 revisions) (flutter/engine#56168)
2024-10-28 [email protected] Roll Skia from 263c3e2ecd30 to f08fbc465888 (1 revision) (flutter/engine#56170)

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] 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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…racked. (flutter/engine#56153)

By passing the shared_ptrs to TrackedObjectsVK by value, we will always require at least a decrement of the shared_ptr count, and possibly an increment too. 

Since for most cases the tracked object has already been tracked, passing by const ref results in no increment or decrement.

Ignoring the time value, since this is a flamegraph, we can see almost all time spent tracking is spent on shared_ptr decrement:

![image](https://github.com/user-attachments/assets/aeae405b-1e5a-4d97-a9a3-b7668cec0714)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants