maplibre-native icon indicating copy to clipboard operation
maplibre-native copied to clipboard

Performance issues on iOS 14

Open degtiarev opened this issue 3 years ago • 8 comments

Hi. There are performance issues that appears when there's any Custom annotation in the current viewpoint on mapview. I guess these issues are critical for anyone who shows Custom annotations on mapview.

They are noticeable even in this simple example from mapbox doc.

Mapbox team fixed them in v6.2.0. These are two issues from mapbox/mapbox-gl-native-ios connected with them:

  1. On iOS 14 MGLAnnotationView slows down map significantly #350
  2. Fix map stuttering by switching render call to use setNeedsDisplay #411

This commit does not fix the issues I described.

degtiarev avatar Mar 10 '21 14:03 degtiarev

I did have a look into the issue and there doesn’t seem to be any related changes in the core library so hopefully the fix could be cherry picked from https://github.com/mapbox/mapbox-gl-native-ios/pull/411/files?file-filters%5B%5D=.h&file-filters%5B%5D=.md&file-filters%5B%5D=.mm

petr-pokorny-1 avatar Mar 10 '21 23:03 petr-pokorny-1

Hi @petr-pokorny-1 @degtiarev,

Yes it seems that relevant parts of https://github.com/mapbox/mapbox-gl-native-ios/pull/411/files can be applied and in my tests seems to fix the performance issue with annotations. Created PR https://github.com/maplibre/maplibre-gl-native/pull/60

juhieta avatar Mar 29 '21 16:03 juhieta

Hi, Is it already cherry picked and resolved by Maplibre team? I also have slow down(stuttering) on zoom while using MGLAnnotationView instead of MGLAnnotationImage. Any progress?

roman-mykitchak avatar Apr 27 '21 12:04 roman-mykitchak

Hi @roman-mykitchak, yes the cherry pick PR was merged to master, have you tried the performance with the latest version? However the PR seems to cause some assertion failure in metal-support -branch as noted here. So we'll need to have look what is causing that before closing this issue.

juhieta avatar Apr 27 '21 14:04 juhieta

@juhieta I am experiencing similar lag as @roman-mykitchak, has this change been released yet? AFAIK last official release was in March, and since then there's just this pre-release. Did anyone test using the Metal support yet?

ferologics avatar May 20 '21 10:05 ferologics

Hi @ferologics, unfortunately it has not yet been released (the last iOS release was done before the #60 merge). There's this one assertion check fail that needs to be checked on the Metal branch. Btw, if MGLSymbolStyleLayer and MGLShapeSource work for your use case, they are better performing option in general.

juhieta avatar May 20 '21 12:05 juhieta

@juhieta thanks for the pointer, unfortunately we have to use custom annotation views. I suppose there won't be a release before Metal support is rolled out @petr-pokorny-1 ?

Could anyone instruct me on how to test with this change in a fork? As simple as pointing to master branch? Or do we need to build and point to a custom binary with the change?

ferologics avatar May 20 '21 14:05 ferologics

I think there was a release since the last comment. Did you see performance improvements, @ferologics or @degtiarev?

wipfli avatar Jul 01 '22 14:07 wipfli