nightscout / AndroidAPS

Opensource automated insulin delivery system (closed loop)
https://wiki.aaps.app
GNU Affero General Public License v3.0
696 stars 1.7k forks source link

[last dev] AAPS temporary frozen after a time rescale of graph #801

Closed Philoul closed 2 years ago

Philoul commented 2 years ago

No crash, but just annoying, very often, when I change time range of the graph I get a popup AndroidAPS is not responding (always press Wait button and it's Ok). I also get some temporary artefact in the graph during the following 5 min (vertical bar in the left, wrong scale for TBR...) Screenshot_20211025-080253_AndroidAPS

Screenshot_20211025-080315_AndroidAPS

Philoul commented 2 years ago

Copy paste my comment from #822 to #801 (most of it is linked to this issue).

I tried to fix it a few months ago with always preparing data for max range of data for all curves (24h + prediction) and return selected range. I made a PR (not merged) that fixed the temporary vertical bar on the left and displayed immediatly all curves on rescale, but I closed it because it was not compatible with History Browser 😞... My other idea was to only calculate required data on new entry or each 5 min (most of time 99% of graph values are already calculated, and it's only when we enter insulin or carbs in the past that we have to calculate again a subset of values), keep in memory 24 or 48h of graph values and save older one in database to be able to show immediatly all curves in historybrowser (without calculation) and in overview...

MilosKozak commented 2 years ago

caching simliar to what you describe is in place