fmidev / weather-app

FMI's official weather application for mobile devices
7 stars 2 forks source link

Optimize observation loading #680

Open geosaaga opened 1 week ago

geosaaga commented 1 week ago

Currently we load 72h hours observations for every observations station and observation data is huge because some stations measure observations every minute. Observation data for example to Helsinki contains > 220000 lines when formatted. The data is heavy to load and handle and most users never check the data for every station.

There are quite many ways to improve logic. One quite simple way could be to load only 24 h observations initially and then load more when user starts to interact with graph or observation list. This would also allow to show more than 72 hours of observations in the graph. This would reduce initial data about 66% compared to current situation.

24h would be enough to show initial view of the graph same way like now.

AnttiRumpunen commented 1 week ago

Observation loading also freezes UI until it finishes. Should be executed in background and show some sort of "loading" icon while loading.

Maybe use 10minute values in graphs or something instead of 1 minute values.