analytics
analytics copied to clipboard
Generating the diagram is very slow with huge data source
I have a data source with 75.000 rows. Generating the diagram takes ~30 seconds on my laptop. During the generation the browser tab uses 100% cpu and is unresponsive. Hovering over the diagram to see the actual values is very slow, too. Also zooming in on the diagram is very slow.
My setup:
- Firefox 119.0 (64-Bit)
- Testfile: 2023_10_PV.csv
- Selected rows: 1,2,4
- Diagram type: timeline (date in 2nd column)
The testfile is a monthly csv file of a smart plug from myStrom. It records the values every 30 seconds.
Questions:
- Is there a way to pregenerate the diagram on the server? This way the diagram does not need to be generated with every page load again and again.
- Is the performance impact expected with that much rows in the data source?
Additionally, when I add the diagram to the favorites I encounter two more problems:
- Opening the Analytics app takes ~30 seconds, because the overview page generates the diagram and therefore slows down the whole page.
- Same thing happens when I use the Analytics widget on the Nextcloud dashboard. The whole pages gets unresponsive.
It is very frustrating for the user to wait until the last diagram preview was generated, to be able to click on something else. Especially on the dashboard where you generally just want to jump to a specific app quite fast.
I would recommend to implement a time limit for generating diagrams. Or eventually only for those in the favorites. For example if the diagram is not generated after 2 seconds, the diagram wont be shown. Or perhaps a little reload-icon could be shown instead of the diagram after the time limit is reached. By clicking on this icon the user could enforce the generation of the diagram. But perhaps there are much better ways to handle this. I don't have much knowledge in those things.
Hello,
thank you for the remark. I am not sure if chart.js has a time limit, but its a good idea. Regarding pre-aggregation: that would mean that the data is somehow totaled/summed up per some kind of grouping on the time-column. will be interesting to evaluate. One idea would be to connect this kind of grouping to the axis-unit parameter (days, month, hour) which also condenses the information - but on a frontend level.
Definitely a valuable remark, but needs some time to evaluate a good solution...