googlemaps / googlemaps/google-maps-ios-utils
Clustering: Bad framerate on new devices
- Dominant language
- Objective-C
- Stars
- 778
- Forks
- 441
- PR merge metrics
- No merged PRs in 30d
Description
Enabling clustering makes moving around the map really choppy, as in the framerate stutters.
My app has been using clustering for many years, and this issue seems to be happening to newer devices. I noticed when I got an iPhone 13. I have asked some of my users with older devices, and they don't experience this issue.
My app don't really show many markers. Around 500 at the most. If I disable clustering and render all the markers then performance is great (though usability suffers due to the crowded map). If I enable clustering, even zooming out so I only see a couple of clusters and no other markers, it still stutters the same.
The offending code seems to be this:
https://github.com/googlemaps/google-maps-ios-utils/blob/f2cb6793d431fbf01b3d573fca083011a5e1cfc8/src/Clustering/View/GMUDefaultClusterRenderer.m#L235-L236
If I comment out that line of code and just set `shouldShowCluster` to always `true` then it works smooth again. For some reason the performance has an issue with using map projection.
There is a very relevant bug report for Google Maps here: https://issuetracker.google.com/issues/219068007
The app I have in production right now is using Google Maps v2.7.0 and utils v2.0.0, and it has this problem. Updating to newest version of everything does not help.
The issue is either in iOS or Google Maps, so unless you have a good workaround that does not use projection, then this probably have to wait for someone else to fix it.
#### Environment details
iOS: v15.4.1
Device: iPhone 13
Google Maps: v2.7.0, v6.2.1
Google Maps iOS Utils: v2.0.0, v4.1.0
#### Steps to reproduce
1. Follow the steps here to setup the demo app: https://developers.google.com/maps/documentation/ios-sdk/utility/setup#get-demo
2. Install the demo app on an iPhone 13
3. Move around the map and notice how the framerate is really bad
Contributor guide
Assessment
This issue has not been assessed yet.