quickbird-uk / QuickbirdUWPDashboard

Quickbird UWP App and Server
http://www.quickbird.co.uk/
GNU General Public License v3.0
27 stars 7 forks source link

Improve Loading Speed of the Graphs #7

Open VladimirAkopyan opened 8 years ago

VladimirAkopyan commented 8 years ago

At the moment graphs take a long time to load on crappy computers, like my laptop. It's going to become more of a problem as we accumulate more data. You should add a spinning circle for hte duration of load operation, and see if you can improve loading speed. In our previous app i have tested a few ways of doing that, see here: http://stackoverflow.com/questions/35854862/how-to-read-a-thousand-objects-with-ef7-and-sqlite

VladimirAkopyan commented 8 years ago

I have done some tests and tracked down the problem. Database loads reasonably fast - on the order of 400ms. All the CPU consumption is caused by the line:

ChartSeries.ItemsSource = historicalDatapoints;

This sets the data for each chart series on the graph, and is called for every sensor. Every time that's done, it takes 300ms on my desktop. Perhaps we could avoid this cost if we could set up all the series without triggering UI update every time. Alternatively we could just show a loading bar.

Also check line 129, for the way we wired the Realtime switch.

VladimirAkopyan commented 7 years ago

posponed for now