You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
getExpected() queries emitters from DB by latitude, longitude and type, so we should add an index on latitude, longitude and type to the database.
we get all types of emitters from DB, with the purpose of decreasing trust of the ones we expect, but could not find. But EmitterType.MOBILE has decrTrust 0, so trust cannot be decreased. There is no point in fetching MOBILE emitters from DB.
emitterCache.sync(); is not necessary: the only emitters that are not in DB (or are not updated) are emitters we have in seenSet, and the only purpose of the expected check is decreasing trust of expected emitters that are not in the seenSet.
(+some more potential improvements that require more changes)
The text was updated successfully, but these errors were encountered:
At the end of each reporting period, a check for missing emitters is done:
DejaVu/app/src/main/java/org/fitchfamily/android/dejavu/BackendService.java
Lines 976 to 993 in e54aae2
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:
getExpected()
queries emitters from DB by latitude, longitude and type, so we should add an index on latitude, longitude and type to the database.EmitterType.MOBILE
hasdecrTrust
0, so trust cannot be decreased. There is no point in fetchingMOBILE
emitters from DB.emitterCache.sync();
is not necessary: the only emitters that are not in DB (or are not updated) are emitters we have inseenSet
, and the only purpose of the expected check is decreasing trust of expected emitters that are not in theseenSet
.The text was updated successfully, but these errors were encountered: