-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Only emit image painting events in debug & profile modes. #118872
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
These events were being emitted in release mode, which was showing up in the profiler for my app as taking up a noticeable amount of build time (still well within the frame budget, but this code was near the top of the list).
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. |
@@ -603,7 +603,8 @@ void paintImage({ | |||
return true; | |||
}()); | |||
// Avoid emitting events that are the same as those emitted in the last frame. | |||
if (!_lastFrameImageSizeInfo.contains(sizeInfo)) { | |||
const bool shouldPostEvent = kDebugMode || kProfileMode; |
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.
We usually do !kReleaseMode
instead.
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.
Done
test-exempt: only affects untested configuration |
* 3735231 Cleanup old Dart SDK layout compatibility (flutter/flutter#118819) * 4d25030 Add leak_tracker as dev_dependency. (flutter/flutter#118952) * e3c51a2 Add Windows unit tests to plugin template (flutter/flutter#118638) * d20dd9e Roll Flutter Engine from 7d3233d26d09 to 71ee5f19bc16 (15 revisions) (flutter/flutter#119081) * 5dabe10 Fix path name to discover debug apk on add2app builds (flutter/flutter#117999) * 50ed8a3 Enable `unnecessary_null_comparison` check (flutter/flutter#118849) * 455e6ac Test integration test apps' runner files against current template app (flutter/flutter#118646) * a788e1b Roll Flutter Engine from 71ee5f19bc16 to 59ea78bfabda (2 revisions) (flutter/flutter#119087) * c35370c Roll Flutter Engine from 59ea78bfabda to 2499a5d9fca7 (2 revisions) (flutter/flutter#119089) * 2f0dd56 Refactor highlight handling in FocusManager (flutter/flutter#119075) * 2759f3f Roll Flutter Engine from 2499a5d9fca7 to d98926c32ee7 (2 revisions) (flutter/flutter#119090) * 760fb21 Roll Flutter Engine from d98926c32ee7 to bec40654a5d7 (2 revisions) (flutter/flutter#119093) * bbca694 Roll Flutter Engine from bec40654a5d7 to 5405f2c26e85 (2 revisions) (flutter/flutter#119095) * 6414c36 f1464b49c Manually roll ANGLE, vulkan-deps, SwiftShader (flutter/engine#38650) (flutter/flutter#119097) * 426cdd9 55bb8deaf [Impeller] Linear sample atlas glyphs when the CTM isn't translation/scale only (flutter/engine#39112) (flutter/flutter#119098) * 83c3a61 Only emit image painting events in debug & profile modes. (flutter/flutter#118872) * b113df2 bffb98352 Roll Skia from b72fececbdcc to 8ffd5c20d634 (3 revisions) (flutter/engine#39114) (flutter/flutter#119099) * 351466a Add Decoding Flutter videos to API docs (flutter/flutter#116454) * 318f875 Pass through magnifierConfiguration (flutter/flutter#118270) * eced23e d39ab638b Roll Fuchsia Mac SDK from MUvFS0baOnigVUIND... to _H53AyDxR9Pm2TbwN... (flutter/engine#39122) (flutter/flutter#119126) * 29ab437 Add Material 3 `CheckboxListTile` example and update existing examples (flutter/flutter#118792) * a815ee6 8efc7183b Roll Skia from 8ffd5c20d634 to da5034f9d117 (4 revisions) (flutter/engine#39123) (flutter/flutter#119129)
* 3735231 Cleanup old Dart SDK layout compatibility (flutter/flutter#118819) * 4d25030 Add leak_tracker as dev_dependency. (flutter/flutter#118952) * e3c51a2 Add Windows unit tests to plugin template (flutter/flutter#118638) * d20dd9e Roll Flutter Engine from 7d3233d26d09 to 71ee5f19bc16 (15 revisions) (flutter/flutter#119081) * 5dabe10 Fix path name to discover debug apk on add2app builds (flutter/flutter#117999) * 50ed8a3 Enable `unnecessary_null_comparison` check (flutter/flutter#118849) * 455e6ac Test integration test apps' runner files against current template app (flutter/flutter#118646) * a788e1b Roll Flutter Engine from 71ee5f19bc16 to 59ea78bfabda (2 revisions) (flutter/flutter#119087) * c35370c Roll Flutter Engine from 59ea78bfabda to 2499a5d9fca7 (2 revisions) (flutter/flutter#119089) * 2f0dd56 Refactor highlight handling in FocusManager (flutter/flutter#119075) * 2759f3f Roll Flutter Engine from 2499a5d9fca7 to d98926c32ee7 (2 revisions) (flutter/flutter#119090) * 760fb21 Roll Flutter Engine from d98926c32ee7 to bec40654a5d7 (2 revisions) (flutter/flutter#119093) * bbca694 Roll Flutter Engine from bec40654a5d7 to 5405f2c26e85 (2 revisions) (flutter/flutter#119095) * 6414c36 f1464b49c Manually roll ANGLE, vulkan-deps, SwiftShader (flutter/engine#38650) (flutter/flutter#119097) * 426cdd9 55bb8deaf [Impeller] Linear sample atlas glyphs when the CTM isn't translation/scale only (flutter/engine#39112) (flutter/flutter#119098) * 83c3a61 Only emit image painting events in debug & profile modes. (flutter/flutter#118872) * b113df2 bffb98352 Roll Skia from b72fececbdcc to 8ffd5c20d634 (3 revisions) (flutter/engine#39114) (flutter/flutter#119099) * 351466a Add Decoding Flutter videos to API docs (flutter/flutter#116454) * 318f875 Pass through magnifierConfiguration (flutter/flutter#118270) * eced23e d39ab638b Roll Fuchsia Mac SDK from MUvFS0baOnigVUIND... to _H53AyDxR9Pm2TbwN... (flutter/engine#39122) (flutter/flutter#119126) * 29ab437 Add Material 3 `CheckboxListTile` example and update existing examples (flutter/flutter#118792) * a815ee6 8efc7183b Roll Skia from 8ffd5c20d634 to da5034f9d117 (4 revisions) (flutter/engine#39123) (flutter/flutter#119129)
* 3735231 Cleanup old Dart SDK layout compatibility (flutter/flutter#118819) * 4d25030 Add leak_tracker as dev_dependency. (flutter/flutter#118952) * e3c51a2 Add Windows unit tests to plugin template (flutter/flutter#118638) * d20dd9e Roll Flutter Engine from 7d3233d26d09 to 71ee5f19bc16 (15 revisions) (flutter/flutter#119081) * 5dabe10 Fix path name to discover debug apk on add2app builds (flutter/flutter#117999) * 50ed8a3 Enable `unnecessary_null_comparison` check (flutter/flutter#118849) * 455e6ac Test integration test apps' runner files against current template app (flutter/flutter#118646) * a788e1b Roll Flutter Engine from 71ee5f19bc16 to 59ea78bfabda (2 revisions) (flutter/flutter#119087) * c35370c Roll Flutter Engine from 59ea78bfabda to 2499a5d9fca7 (2 revisions) (flutter/flutter#119089) * 2f0dd56 Refactor highlight handling in FocusManager (flutter/flutter#119075) * 2759f3f Roll Flutter Engine from 2499a5d9fca7 to d98926c32ee7 (2 revisions) (flutter/flutter#119090) * 760fb21 Roll Flutter Engine from d98926c32ee7 to bec40654a5d7 (2 revisions) (flutter/flutter#119093) * bbca694 Roll Flutter Engine from bec40654a5d7 to 5405f2c26e85 (2 revisions) (flutter/flutter#119095) * 6414c36 f1464b49c Manually roll ANGLE, vulkan-deps, SwiftShader (flutter/engine#38650) (flutter/flutter#119097) * 426cdd9 55bb8deaf [Impeller] Linear sample atlas glyphs when the CTM isn't translation/scale only (flutter/engine#39112) (flutter/flutter#119098) * 83c3a61 Only emit image painting events in debug & profile modes. (flutter/flutter#118872) * b113df2 bffb98352 Roll Skia from b72fececbdcc to 8ffd5c20d634 (3 revisions) (flutter/engine#39114) (flutter/flutter#119099) * 351466a Add Decoding Flutter videos to API docs (flutter/flutter#116454) * 318f875 Pass through magnifierConfiguration (flutter/flutter#118270) * eced23e d39ab638b Roll Fuchsia Mac SDK from MUvFS0baOnigVUIND... to _H53AyDxR9Pm2TbwN... (flutter/engine#39122) (flutter/flutter#119126) * 29ab437 Add Material 3 `CheckboxListTile` example and update existing examples (flutter/flutter#118792) * a815ee6 8efc7183b Roll Skia from 8ffd5c20d634 to da5034f9d117 (4 revisions) (flutter/engine#39123) (flutter/flutter#119129)
These events were being emitted in release mode, which was showing up in the profiler for my app as taking up a noticeable amount of build time (still well within the frame budget, but this code was near the top of the list).
Test exemption: we don't test in release mode.
Pre-launch Checklist
///
).