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

Performance Issues with large data sets since 2.x.x #5790

Open
sean-mcl opened this issue Jun 30, 2021 · 7 comments
Open

Performance Issues with large data sets since 2.x.x #5790

sean-mcl opened this issue Jun 30, 2021 · 7 comments
Assignees

Comments

@sean-mcl
Copy link

Hey, we found some performance issues regarding large data sets.

Here is an example with 100k datapoints. When we use the plotly-2.2.0.min.js, the whole plot freezes and has a very bad performance. When we use the plotly-1.58.4.min.js, everything works fine.

LayTec-AG/Plotly.Blazor#99

@sean-mcl sean-mcl changed the title Performance Issues with large data sets Performance Issues with large data sets since 2.x.x Jun 30, 2021
@archmoj
Copy link
Contributor

archmoj commented Jun 30, 2021

Please note that the default hovermode in v1 is x and in v2 is closest.
So with v2 you could simply set layout.hovermode to 'x' for this graph.

@nicolaskruchten
Copy link
Member

Let's investigate this one a bit more... 100k points shouldn't slow down this much in any hovermode, right?

@nicolaskruchten
Copy link
Member

The plots here are much faster and have hovermode=closest (and are rendered with 2.2.0) https://plotly.com/python/webgl-vs-svg/ ... what's the difference? Is closest hovermode much more efficient with a gaussian distribution of points in x/y or something?

@sean-mcl
Copy link
Author

sean-mcl commented Jul 1, 2021

Just tested it with sin data here. The performance impact is huge! When I use linear data, its almost unusable.

@ordinaryorange
Copy link

I can confirm it is definitely a hovermode problem.
I was generating a WebGL scatter of circa 300,000 points where there was small Y variability over X, and the perf was awful
If I generate a synthetic scatter with a larger distribution over Y the perf improves. Changing it to a full continuous Y distribution the perf is just fine.
Coming back to my original scatter, if I set HoverMode=false, no perf issues
HoverMode.x or HoverMode=xUnified = not too bad
Hovermode.y, HoverMode.yUnified or Hovermode.Closest = awful perf
So as @nicolaskruchten indicates it is related to the distribution of data for a given axis.
Anything over about 50,000 points starts to lag if there is no distribution of data
Running v2.6.3 here

@JudeShamsi
Copy link

Has anyone found any solutions to handling the issue? Setting the hovermode to 'x' has improved the hover performance slightly, however as soon as I hover over an area on the screen with many zeros, my app crashes. I'm using react-plotly 2.5.1. This only occurs once I plot more than 100k points. I'm already using scattergl as well.

@hobob0t
Copy link

hobob0t commented Mar 20, 2023

+1 I went back to matplotlib because I need to be able to look at large data sets. Currently attempting a dataframe with 105,983 rows, and anything over 4 columns is just awful.

As others have stated, forcing webgl doesn't help (I think it's default for plotly express anyway). Turning hovermode off works pretty well but drawing the canvas is still a chore. Plus, hovermode is half the reason I use plotly.

If this is truly unfixable due to JS limitations, then I think plotly should feature an automatic subsampling option to reduce the number of points shown.

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

No branches or pull requests

7 participants