maplibre-native
maplibre-native copied to clipboard
Performance issues on iOS 14
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:
- On iOS 14 MGLAnnotationView slows down map significantly #350
- Fix map stuttering by switching render call to use setNeedsDisplay #411
This commit does not fix the issues I described.
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
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
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?
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 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?
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 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?
I think there was a release since the last comment. Did you see performance improvements, @ferologics or @degtiarev?