googlemaps / google-maps-ios-utils

Google Maps SDK for iOS Utility Library
https://developers.google.com/maps/documentation/ios-sdk/utility/
Apache License 2.0
716 stars 408 forks source link

Clustering: Bad framerate on new devices #411

Open blurpy opened 2 years ago

blurpy commented 2 years ago

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
yunnnyunnn commented 2 years ago

I have the same issue too.

wangela commented 2 years ago

Thank you for bringing this to our attention and linking the bug report from the Issue Tracker. We'll provided updates here as we see updates to the SDK issue.

blurpy commented 2 years ago

I have the same issue too.

Remember to vote on the Google Issue Tracker as well, so they know people are affected.

blurpy commented 2 years ago

They closed the issue without any explanation:

Status: Won't Fix (Obsolete)

Do anyone here have any insider details about why it's obsolete? Tried asking about it, but I doubt they are going to answer.

marfurt commented 1 year ago

Hi @wangela, is there any feedback about this issue?

We're experiencing the same issue, but no update has been provided here nor in the Google Issue Tracker.

@blurpy Have you found a solution or a workaround in the meantime?

blurpy commented 1 year ago

@marfurt I'm using the workaround mentioned in the description, disabling the map projection code. Can't use this library without, as the frame drop is really bad.