Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating the diagram is very slow with huge data source #377

Open
hartsberger opened this issue Nov 5, 2023 · 1 comment
Open

Generating the diagram is very slow with huge data source #377

hartsberger opened this issue Nov 5, 2023 · 1 comment
Assignees
Labels
enhancement Feature request

Comments

@hartsberger
Copy link

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:

  1. 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.
  2. 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:

  1. Opening the Analytics app takes ~30 seconds, because the overview page generates the diagram and therefore slows down the whole page.
  2. 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.

@Rello
Copy link
Owner

Rello commented Dec 10, 2023

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...

@Rello Rello self-assigned this Dec 10, 2023
@Rello Rello added the enhancement Feature request label Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request
Projects
None yet
Development

No branches or pull requests

2 participants