Right now, for both areas and for users, if a single new log gets uploaded, the entire set of users and the entire set of areas gets recalculated, even though only the values associated with those logs could feasibly change.
This change makes it so that in the incremental case, we short circuit and only recalculate areas and users who we know have changed
Furthermore, we optimize the user case by updating their stat collection instead of re-calculating it from scratch each time. This has the current downside that a users stats wont update until a log containing their linked account is uploaded, but, currently that's a problem anyway (new users won't see stats until ~24 hours after they join). This can be solved by calculating a user's stats as part of sign up, once user stat calculation is changed to be dynamic/on demand instead of done as part of restat.
Sounds good. Can you push the changes to UAT so we can both do some testing? I believe there should be W7 log changes included as well from my commit previously
Right now, for both areas and for users, if a single new log gets uploaded, the entire set of users and the entire set of areas gets recalculated, even though only the values associated with those logs could feasibly change.
This change makes it so that in the incremental case, we short circuit and only recalculate areas and users who we know have changed
Furthermore, we optimize the user case by updating their stat collection instead of re-calculating it from scratch each time. This has the current downside that a users stats wont update until a log containing their linked account is uploaded, but, currently that's a problem anyway (new users won't see stats until ~24 hours after they join). This can be solved by calculating a user's stats as part of sign up, once user stat calculation is changed to be dynamic/on demand instead of done as part of restat.