n76 / DejaVu

Yet another network location backend for the UnifiedNLP/microG project
GNU General Public License v3.0
100 stars 18 forks source link

Checking for expected emitters has bad performance #47

Open Helium314 opened 2 years ago

Helium314 commented 2 years ago

At the end of each reporting period, a check for missing emitters is done: https://github.com/n76/DejaVu/blob/e54aae2d9f3d4619065a258b431ace1911d1e931/app/src/main/java/org/fitchfamily/android/dejavu/BackendService.java#L976-L993

This makes sense, but is rather slow and not strictly necessary (mostly to clean old data from DB). Performance of this check with a large database is actually so bad that DejaVu may end up as most battery consuming app (according to battery usage in Android settings).

Proposed improvements: