-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Skip the iteration in Layer._fireCompositionCallbacks if the callbacks map is empty #130438
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
Conversation
|
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. |
zanderso
left a comment
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.
LGTM, but not sure how to write a test for this. Maybe @goderbauer can make a suggestion.
|
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. |
|
+1 to that. I think this should get a test exception from Hixie. |
|
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
d92fef1 to
b41d54a
Compare
|
Google testing is red on this PR due to needing a rebase, so I clicked the rebase button. |
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…callbacks map is empty (flutter/flutter#130438)
…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
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