Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JGreenlee opened this issue May 6, 2024 · 1 comment

Comments

@JGreenlee
Copy link

JGreenlee commented May 6, 2024

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:

  • limit the number of scans that occur on the phone (for battery drain considerations)
  • limit the number of scans that get recorded to DB (for scalability considerations on the server while processing)
@JGreenlee
Copy link
Author

JGreenlee commented May 6, 2024

@the-bay-kay recently addressed extraneous transitions (e-mission/e-mission-data-collection#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

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

No branches or pull requests

1 participant