[google_maps_flutter] Avoid unnecessary map element updates (performance)#2235
[google_maps_flutter] Avoid unnecessary map element updates (performance)#2235cyanglaz merged 8 commits intoflutter:masterfrom
Conversation
|
@iskakaushik Just noticed the |
|
These changes are providing a significant performance improvement to our app. Our app can contain 100+ png markers generated from a widget and as that number increases, page transitions become less smooth etc. |
|
@britannio if you have performance issues with markers generated from bytes as well, feel free to upvote the issue I created about this flutter/flutter#41731 ;) |
cyanglaz
left a comment
There was a problem hiding this comment.
LGTM! Please rebase and I will merge it.
9bf55d9 to
3236cb3
Compare
|
@cyanglaz done! 😉 |
cyanglaz
left a comment
There was a problem hiding this comment.
Thanks! There seem to be something happen during rebase and could you fix those?
a08ca30 to
5e242c7
Compare
Description
Currently, all attributes of map elements are taken into account when computing which one have changed and needs to be rebuilt. This causes changes in attributes that are not related to the platform (like
onTaporonDragEnd) to trigger an unnecessary rebuild of the element. This is especially problematic as new instances of closures are often used in those handlers resulting in lots of unnecessary rebuilds.This PR address that problem by ensuring attributes not related to the platform are ignored when comparing elements for change.
Related Issues
This PR reduces drastically performance problems explained in this issue:
flutter/flutter#41731
However, this is only one part of the problem, so this issue still needs some love <3
Checklist
///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?