Skip to content

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

@sean-mcl

Description

@sean-mcl

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

Activity

changed the title [-]Performance Issues with large data sets[/-] [+]Performance Issues with large data sets since 2.x.x[/+] on Jun 30, 2021
archmoj

archmoj commented on Jun 30, 2021

@archmoj
Contributor

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

nicolaskruchten commented on Jun 30, 2021

@nicolaskruchten
Contributor

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

nicolaskruchten

nicolaskruchten commented on Jun 30, 2021

@nicolaskruchten
Contributor

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

sean-mcl commented on Jul 1, 2021

@sean-mcl
Author

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

ordinaryorange

ordinaryorange commented on Mar 15, 2022

@ordinaryorange

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

JudeShamsi commented on Aug 21, 2022

@JudeShamsi

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

hobob0t commented on Mar 20, 2023

@hobob0t

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

self-assigned this
on Jul 5, 2024

6 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokenperformancesomething is slow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nicolaskruchten@gvwilson@iDevGeek@ordinaryorange@archmoj

        Issue actions

          Performance Issues with large data sets since 2.x.x · Issue #5790 · plotly/plotly.js