Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

MapBox on Simulator extremely slow on Xcode 10 #172

Closed
pappalar opened this issue Mar 6, 2019 · 11 comments
Closed

MapBox on Simulator extremely slow on Xcode 10 #172

pappalar opened this issue Mar 6, 2019 · 11 comments

Comments

@pappalar
Copy link

pappalar commented Mar 6, 2019

Hello!

I noticed similar issues opened for Xcode 9 (like mapbox/mapbox-gl-native#10199).
I nearly can't use the map in the simulator.

I would like to know if this is a known issue, some settings I need to configure or something else.

I included the map in a view controller:

class MapViewController: UIViewController {

private lazy var mapView: MGLMapView = {
        let mapView = MGLMapView(frame: view.bounds, styleURL: mapBoxUrl)
        mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        // Set the map view's delegate
        mapView.delegate = self
        view.addSubview(mapView)
        return mapView
    }()
}

and the entire controller containing the map is included in another controller via child-parent connection:

func add(child: UIViewController, to parent: UIViewController) {
        parent.addChild(child)
        parent.view.addSubview(child.view)
        child.didMove(toParent: parent)
    }


extension ContainerViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        add(child: mapViewController, to: self)
        
        
    }
}

Configuration

  • Mapbox SDK version: Mapbox-iOS-SDK (4.9.0)
  • iOS version: 12.1
  • macOS version: 10.14.3 (18D109)
  • Device/simulator models: iPhone XR
  • Xcode version: Version 10.1 (10B61)

Thanks

@julianrex
Copy link
Contributor

julianrex commented Mar 6, 2019

Thanks for the report @racer1988.

It looks like you have a minimal setup, so things ought to be ok.

We do have a known issue caused by poor performance of some of the accessibility code, which can be triggered when using the simulator AND window management tools. For example, I had a similar experience when running Magnet.

Are you running anything like this?

@fabian-guerra
Copy link
Contributor

Hi, @racer1988.

I'm using the same Xcode version as you Version 10.1 (10B61) and haven't notice any slowness. Have you tried in a different mac with different conf as yours? Also note that in the comment points that you may have other tools interfering.

@pappalar
Copy link
Author

pappalar commented Mar 6, 2019

Hi @julianrex @fabian-guerra!
Thank you for your replies.

I do not use any window management tool. I don't believe that is the issue.

Please let this issue open:

  • I will try to replicate the issue on a empty new project and slowly move toward the setup I have in my current application to see if I can find a culprit
  • If I can reproduce the issue immediately I will share the project file and ask also a collegue to test it out to see if the combination of tools might be the root cause.

Keep you posted soon!

@pappalar
Copy link
Author

pappalar commented Mar 6, 2019

@julianrex @fabian-guerra I did a quick test run and here are some results.

Test results:

1- I can reproduce the issue on my machine, using an empty project.
2- I can reproduce the issue using the standard style.
3- Using my custom style (that has additional layers of data) makes the performances even worse
4- The issue present itself only at lower zoom levels. At zoom level 1 there is practically no issue. at higher zoom levels the lag increase more and more.

Tomorrow I will:

  • Test on a different machine
  • Prepare and share the test project.

Additional details:

  • The project is using CocoaPods to install Mapbox.

Logs:

{}[General]: GPU Identifier: Apple Software Renderer

Investigation:

It looks to me that the poor performances are because the renderer is not fast enought and fills the main thread to 100% losing scrolling frames:

screenshot 2019-03-07 at 00 15 33

@pappalar
Copy link
Author

pappalar commented Mar 7, 2019

@julianrex @fabian-guerra I tested this on different machine and settings:

  • This issue only is with the Simulator (as stated originally)
  • This issue occurs on all machine I tested.

1- Disabling macOS Automatic Graphic Switching feels it improves slightly the performances.
2- Issues seems more prominent with "Hill Shading" (less prominent in a flat area like Berlin, more prominent in the Alps)
3- Custom style makes it close to unusable. Lag and performance issues are visible also with default Style

Here is the bare minimum project: https://github.com/racer1988/MapboxSimulatorLag
Note: Token is redacted

Here is a Video of the issue (in the same repo):
https://github.com/racer1988/MapboxSimulatorLag/blob/master/lag.mov

@pappalar
Copy link
Author

up

@luizmello
Copy link

Hi, I'm also have very bad simulator performance.
I tested with different machines and different simulators too.
When I run the application in a device there is no lag.

In some tests I can notice a very large memory allocation when I set the zoom map between 5 and 15.
If I set the zoom to 4 or 16 this issue don't occurs.

@stale
Copy link

stale bot commented Dec 28, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Dec 28, 2019
@julianrex julianrex reopened this Feb 19, 2020
@julianrex julianrex transferred this issue from mapbox/mapbox-gl-native Feb 19, 2020
@raho
Copy link

raho commented Mar 27, 2020

I'm also experiencing poor performance on the simulator. Using Xcode 11.4
In the logs I see: GPU Identifier: Apple Software Renderer

@kajensen
Copy link

I'm seeing this issue with the window manager app Magnet (mentioned above). Odd bug.. will this be fixed?

@julianrex
Copy link
Contributor

This was fixed by #318, which was included in the iOS 6.0.0 SDK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants