fleaflet / flutter_map

A versatile mapping package for Flutter. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.
https://pub.dev/packages/flutter_map
BSD 3-Clause "New" or "Revised" License
2.68k stars 848 forks source link

[BUG] 7.0.0 -> 7.0.1 performance regression #1913

Closed mootw closed 5 days ago

mootw commented 3 weeks ago

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

mootw commented 3 weeks 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:

mootw commented 2 weeks ago

https://pub.dev/packages/collection ^ use this for list equality

josxha commented 2 weeks ago

fast_immutable_collections could be interesting as well because it caches the hashCode of its list types.