I'm facing with issue related to long loading time of the empty map from Here-SDK-iOS
.
I opened sample project and looks like it freeze for some time, the code for initialisation is next:
override func loadView() {
super.loadView()
NSLog("%@", ">>>>>>>>>> Load View \(Date())")
}
override func viewDidLoad() {
super.viewDidLoad()
mapView = MapView(frame: view.bounds)
view.addSubview(mapView)
mapView.mapScene.loadScene(mapScheme: .normalDay, completion: self.onLoadScene)
mapView.gestures.tapDelegate = self
NSLog("%@", ">>>>>>>>>> View Did Load \(Date())")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
mapView.handleLowMemory()
}
func onLoadScene(_ error: MapError?) {
guard error == nil else {
print("Error: Map scene not loaded, \(String(describing: error))")
return
}
// Configure the map.
let camera = mapView.camera
camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991),
distanceInMeters: 1000 * 10)
}
The log:
2021-06-25 08:45:27.500549+0300 testDrawing[50019:31547554] >>>>>>>>>> Load View 2021-06-25 05:45:27 +0000
...
2021-06-25 08:45:31.301998+0300 testDrawing[50019:31547554] >>>>>>>>>> View Did Load 2021-06-25 05:45:31 +0000
As u can see there is about 4 sec to init the map with initial location. Note: I use freemium account for testing.
I also can see additional warnings like
[WARN ] harp-sdk - Ignore adding invalid observer
[WARN] ResponseFromJsonBuilder - Absent value, response=olp::authentication::IntrospectAppResult, field=description
[INFO ] harp-sdk - Adding data source
[INFO ] Storage.LevelDB - Cleared other DB in folder: "/Users//Library/Developer/CoreSimulator/Devices/61082972-C4BE-42E2-9696-0D2458D475D5/data/Containers/Data/Application/74E993BF-7111-4E08-A27F-A7F62B3ADA1D/Library/Caches/v1/sSR8TFucGSrS94S4sDvrsA/analyticsData/events.sqlite
[INFO] ThreadPoolTaskScheduler - Starting thread 'OLPSDKPOOL_0'
The most time consuming operation - is Cleared other DB in folder
- about 3 sec.
Can anyone advice what's the reason for this behaviour.
---- UPDATE -----
I also receiving random crash
version = heresdk-explore-ios-4.7.5.0.5737
---- UPDATE -----
Few mode tech details:
For issue «freeze on start":
tested on Mac with M1 and simulator (12 Pro, iOS 14.5) and on device 12 Pro iOS 14.5. On device lag a bit smaller - 1-3 sec, on simulator - up to 7 sec. heresdk-explore-ios-4.7.5.0.5737 heresdk-navigate-ios-4.7.6.0.5863
For "crash on start":
12 Pro, iOS 14.5 both heresdk-explore-ios-4.7.5.0.5737
---- UPDATE ----
Hi, the crash with analytics service must be fixed in upcoming release. The most time consuming operation - is
Cleared other DB in folder- about 3 sec.
There is no evidence that this operation consumes 3 sec, probably something happen after this operation. – Hsilgos
@Hsilgos,
Yes, there is no evidence that exactly this operation consume 3 sec - it's just a guess from my side (when I remove sdk - everything works instantly, so this is simple check).
Here few screenshots from profiler:
Here is the trace file
Here u can see that HARP.SDK.RENDERER (map renderer I guess) eat a lot of resource, and looks like MainThread is waiting until it's done.
Again - this is just a guess.
Another point for improvement - add support for running fat on arm64 Darwin simulator on M1. For not I need to use Rosetta ( - this disappointing....
---- UPDATE ----
Issue with drawing performance - example (when around 200 items are drawn at once, to be more precise - one-by-one - there is no API for batch drawing):
Look at second drawing area - the performance issue is more visible there