Skip to content

Conversation

@jason-simmons
Copy link
Member

This was showing up as a hot spot in some benchmarks and profiles. This function is called frequently during frame builds and often has an empty map. There may be significant overhead from obtaining the values iterator and cloning it into a list.

See #130339

@jason-simmons jason-simmons requested a review from zanderso July 12, 2023 19:36
@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 Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on 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.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 12, 2023
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

LGTM, but not sure how to write a test for this. Maybe @goderbauer can make a suggestion.

@jonahwilliams
Copy link
Contributor

If the only effect we care about from this change is an improvement in performance, then I think the patch is fine as is.

As @Hixie would say, would you care if anyone reverted your patch? Well if the benchmark doesn't regress (because Dart fixed the underlying issue), then no, I probably wouldn't care.

@goderbauer
Copy link
Member

+1 to that. I think this should get a test exception from Hixie.

@Hixie
Copy link
Contributor

Hixie commented Jul 13, 2023

test-exempt: code refactor with no semantic change

…s map is empty

This was showing up as a hot spot in some benchmarks and profiles.
This function is called frequently during frame builds and often has
an empty map.  There may be significant overhead from obtaining the
values iterator and cloning it into a list.

See flutter#130339
@zanderso zanderso force-pushed the bug_130339_callbacks branch from d92fef1 to b41d54a Compare July 17, 2023 15:14
@zanderso
Copy link
Member

Google testing is red on this PR due to needing a rebase, so I clicked the rebase button.

@zanderso zanderso merged commit 7937b1d into flutter:master Jul 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 19, 2023
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
…s map is empty (flutter#130438)

This was showing up as a hot spot in some benchmarks and profiles. This
function is called frequently during frame builds and often has an empty
map. There may be significant overhead from obtaining the values
iterator and cloning it into a list.

See flutter#130339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants