e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 34 forks source link

💪 Decreasing the frequency/quantity of BLE scans for better performance #1072

Open JGreenlee opened 6 months ago

JGreenlee commented 6 months ago

The quantity of background/bluetooth_ble entries is staggering and likely much more than we need.

In the April 24 dump of dfc-fermata, my user has 54208 background/bluetooth_ble entries. That would have been from a bit over 1 week of testing, since I believe we rolled out the alpha on the 15th or 16th. By comparison, there were only 14003 background/location entries during that timespan. That was on an iOS device.

We should look at the differences between iOS and Android and try to:

JGreenlee commented 6 months ago

@the-bay-kay recently addressed extraneous transitions (https://github.com/e-mission/e-mission-data-collection/pull/230), which will also help performance but I don't think it will limit the number of background/bluetooth_ble entries

@shankari found that iOS does not offer a way to adjust the scan frequency during ranging: https://developer.apple.com/documentation/corelocation/cllocationmanager/3240607-startrangingbeaconssatisfyingcon?language=objc So it may be necessary to start and stop ranging throughout the trip (for example, maybe we range for 10s every 1 minute, and then maybe we record a subset of those scans)

@louisg1337 I do not know what performance is like on Android currently