mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

[Performance] dispatchTelemetryTurnstileEvent on main thread

Open florianPOLARSTEPS opened this issue 3 years ago • 1 comments

Environment

  • Android OS version: any
  • Devices affected: any
  • Maps SDK Version: 10.7.x - 10.8.x (but probably more)

Observed behavior and steps to reproduce

I have been doing some benchmarking of startup times for my screens that contain mapbox maps, and found that a significant portion of startup time comes from firing Turnstile events during mapcontroller startup.

I guess it's necessary to do those things, but do they really have to run on the main thread? Screenshot 2022-09-02 at 09 48 19

Expected behavior

Better startup performance of the map.

Notes / preliminary analysis

If you look at the screenshot of the CPU trace from Android studio, a lot of it comes from just reading the phone state (network info) from the system. I do not believe any of those system calls need to happen on the UI thread.

florianPOLARSTEPS avatar Sep 02 '22 08:09 florianPOLARSTEPS