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

Conversation

@jonahwilliams
Copy link
Contributor

Otherwise we do three hashmap lookups everything we call OptionsFromPass(AndEntity) in a contents.

Before

16 / 392 = 4%

image

After

6/ 458 = 1.3%

image

RenderPass::RenderPass(std::weak_ptr<const Context> context,
const RenderTarget& target)
: context_(std::move(context)),
sample_count_(target.GetSampleCount()),
Copy link
Member

Choose a reason for hiding this comment

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

This could potentially lead to bugs since a RenderTarget's result to GetSampleCount isn't const. A call to RenderTarget::SetColorAttachment can change the results of GetSampleCount. Can we instead cache the result on the RenderTarget? There we have the knowledge to know if it has become stale.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The RenderTarget is a const property of the RenderPass, can only by accessed by a const reference, and is copied into the RenderPass on construction - this should be safe:

image

`

Copy link
Member

Choose a reason for hiding this comment

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

Okay, I just saw the copy. This should be good. Can you add a comment to before these cached values why it is safe to cache this values. That at least gives a breadcrumb in case someone changes render_pass to a shared_ptr or something. Something like "These values are cached for performance and are safe since RenderPass owns a const copy of the RenderTarget".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

LGTM modulo a comment since someone could easily make this thing that is safe, not safe.

@jonahwilliams
Copy link
Contributor Author

Thanks @gaaclarke !

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 22, 2023
@auto-submit auto-submit bot merged commit bae7a8c into flutter:main Nov 22, 2023
@jonahwilliams jonahwilliams deleted the options_from_pass_cache branch November 22, 2023 19:16
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 22, 2023
…ions) (#138918)

Manual roll requested by [email protected]

flutter/engine@342fb00...f331e0a

2023-11-22 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] pass const ref to binding helpers." (flutter/engine#48330)
2023-11-22 [email protected] Revert "Manual roll Dart SDK from f1fd14505782 to df958dc1ca7b (6 revisions)" (flutter/engine#48325)
2023-11-22 [email protected] [Impeller] cache render target properties on Render Pass. (flutter/engine#48323)
2023-11-22 [email protected] [Impeller] pass const ref to binding helpers. (flutter/engine#48318)
2023-11-22 [email protected] Roll Skia from 994558cd1fae to 30ecaac60b47 (1 revision) (flutter/engine#48324)
2023-11-22 [email protected] Roll Skia from 9086788fc341 to 994558cd1fae (1 revision) (flutter/engine#48322)
2023-11-22 [email protected] Expose a few more glyph apis from `ui.Paragraph` (flutter/engine#47698)
2023-11-22 [email protected] Roll Skia from efdec1f459ce to 9086788fc341 (2 revisions) (flutter/engine#48317)
2023-11-22 [email protected] Manual roll Dart SDK from f1fd14505782 to df958dc1ca7b (6 revisions) (flutter/engine#48316)

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
…ions) (flutter#138918)

Manual roll requested by [email protected]

flutter/engine@342fb00...f331e0a

2023-11-22 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] pass const ref to binding helpers." (flutter/engine#48330)
2023-11-22 [email protected] Revert "Manual roll Dart SDK from f1fd14505782 to df958dc1ca7b (6 revisions)" (flutter/engine#48325)
2023-11-22 [email protected] [Impeller] cache render target properties on Render Pass. (flutter/engine#48323)
2023-11-22 [email protected] [Impeller] pass const ref to binding helpers. (flutter/engine#48318)
2023-11-22 [email protected] Roll Skia from 994558cd1fae to 30ecaac60b47 (1 revision) (flutter/engine#48324)
2023-11-22 [email protected] Roll Skia from 9086788fc341 to 994558cd1fae (1 revision) (flutter/engine#48322)
2023-11-22 [email protected] Expose a few more glyph apis from `ui.Paragraph` (flutter/engine#47698)
2023-11-22 [email protected] Roll Skia from efdec1f459ce to 9086788fc341 (2 revisions) (flutter/engine#48317)
2023-11-22 [email protected] Manual roll Dart SDK from f1fd14505782 to df958dc1ca7b (6 revisions) (flutter/engine#48316)

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.

Labels

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

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants