Closed mootw closed 5 days ago
created reproducible example. it seems to be related to dynamic update, and creating full sets of new polygons each build
https://github.com/mootw/flutter_map/commit/52c347de72045acaa1ba94118c0bc736974381bd
there was some discussion and i think its important to note a few things:
what things should trigger new state or modifying state. these checks need to be efficient (as in fast enough to be worth it over just rebuilding each time). in some cases it is OK to rebuild every time and not cache.
I had to use UniqueKey() in my workflow after changing from 7.0.0 -> 7.0.1 to restore some of the performance (UniqueKey skips the didModify widget checks which rebuilds the entire state every time and caches it. but the cache is obviously never used.) this resulted in performance somewhere between 7.0.0 -> 7.0.1 without any changes to my code.
I think this use case is fairly normal and a user could expect to change the values regularly. Im generally avoidant of micro-optimizations as they can often result in performance trade-offs that are not worth it OR might require strong documentation.
how can we make the polygon/polyline widget build behavior consistent and expected. i believe that #1904 was created to help maintain consistent behavior (see #1894 which it fixed), however at a huge performance cost. I want to look at a way to maintain good/expected behavior without adding too many checks in the way.
https://pub.dev/packages/collection ^ use this for list equality
fast_immutable_collections could be interesting as well because it caches the hashCode of its list types.
What is the bug?
Polygon renderer is significantly slower on 7.0.1 in real world data
large performance drop when panning (my feeling is 60+fps->20) huge performance drop when zooming (60+fps -> 5)
I also see Z fighting with the polygon renderer in some cases where 7.0.0 did not have any z fighting
How can we reproduce it?
useDynamicUpdate: false fixes the performance issue and causes significant rendering issues (not rendering when zoomed in, and only some polygons rendering) in real world data.
Do you have a potential solution?
i believe that reverting #1904 will fix the issue
Platforms
Android
Severity
Obtrusive: Prevents normal functioning but causes no errors in the console