Skip to content

poor performance of chart layout when data includes rangebreaks #5630

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

Closed
spasovski opened this issue May 5, 2021 · 2 comments · Fixed by #5659
Closed

poor performance of chart layout when data includes rangebreaks #5630

spasovski opened this issue May 5, 2021 · 2 comments · Fixed by #5659
Milestone

Comments

@spasovski
Copy link
Contributor

My team detected a significant performance issue with charts when rangebreaks are involved. Example chart at https://codepen.io/spasovski/pen/wvgVRNV and is even better demonstrated at https://jsbench.me/zpko8zmpic/1

This makes the charts quite slow to generate and more specifically update (as would be the case in a ticking chart). The main thread tends to lock up when lots of data points are involved and affects the overall usability of the rest of the page.

A team member first found the likely culprit at

if(ax.rangebreaks) {
since this then kicks off ax.maskBreaks(), and this only multiplies as the the number of rangebreaks increases.

Please let me know if a performance recording/screenshot would also be of benefit.

@dsmmcken
Copy link

dsmmcken commented May 6, 2021

https://jsbench.me/zpko8zmpic/2

5000 points with 300 range breaks is 99% slower at plotting than with no breaks.

The biggest slow down seems to be doing the dateTime2ms for every point * every range break, so in this case 1,509,346 times for the 5000 points.

@nicolaskruchten
Copy link
Contributor

Thanks for flagging this! We'd love a PR if someone wants to take on this optimization work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants