mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

App taking SUUUUUPER long to start up if user has a lot of offline maps

Open georgbachmann opened this issue 5 years ago • 0 comments

I am currently playing around with the mapbox for iOS SDK and tried to download a huge offline map. I then noticed when starting the app afterwards, that it takes forever until the app is really loaded. I started investigating with Instruments and found mbgl::OfflineDatabase::initAmbientCacheSize() (running the sql-query in there) taking about 9 seconds in my case. Also, when I initialize MGLOfflineStorage on app launch (to check for unfinished downloads) it will take even longer (hanging in mbgl::OfflineDatabase::getCompletedTileCountAndSize(long long).

Also... while downloading the offline map, my iPhone get really really hot (100% CPU usage while downloading) and in the logs I also saw: QUARANTINED DUE TO HIGH LOGGING VOLUME

Is there anything to do about the problem?

Steps to reproduce

  1. Download a super large offline map region

Expected behavior

No difference in app-start time

Actual behavior

App hangs forever to start up

Configuration

Mapbox SDK versions: 6.0 iOS/macOS versions: 13.6 Device/simulator models: iPhone X Xcode version: 11.6

georgbachmann avatar Aug 10 '20 11:08 georgbachmann