You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From #2527, Plots.supplyDefaults takes > 100ms at 50x50 subplots which feels like an eternity when zooming.
Getting rid of indexOf into axis lists would be a good start (perhaps experimenting with ES6 Map and Set could be worthwhile)
Perhaps we could try opening a partial Plots.supplyDefaults pathway, that would only update a subset of the graph's cartesian axes and their dependencies.
at 50x50 subplots, about 95% of the Plots.supplyDefaults duration takes place in supplyLayoutModuleDefaults (which coerces all those axes) and Plots.linkSubplots. The latter is especially heavy for multi-subplot graphs. Here:
for every anchor-less axis, it loops over all subplots.
So I'm thinking of moving this block out of Plots.linkSubplots and into the lsInner subroutine so that "easy" edit types such as 'legend', 'axrange', 'ticks' and 'modebar' don't have to go through it. Referencing #2227 (comment) where something similar was proposed.
So I'm thinking of moving this block out of Plots.linkSubplots and into the lsInner subroutine
Sounds reasonable. Another option - not necessarily mutually exclusive, we could do both in fact - would be to make another collation of subplots that maps each (x|y) axis onto the (y|x) axes it makes subplots with. That should substantially reduce the size and complexity of loops like this.
PR #2628 also added set axis anchors to all sploms except the ones with showlowerhalf: false so that the "find main subplot" loop is skipped when we can.
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson
Activity
etpinard commentedon Apr 19, 2018
Some more observations:
Plots.supplyDefaultsduration takes place insupplyLayoutModuleDefaults(which coerces all those axes) andPlots.linkSubplots. The latter is especially heavy for multi-subplot graphs. Here:plotly.js/src/plots/plots.js
Lines 820 to 855 in 4ed586a
for every anchor-less axis, it loops over all subplots.
So I'm thinking of moving this block out of
Plots.linkSubplotsand into thelsInnersubroutine so that "easy" edit types such as 'legend', 'axrange', 'ticks' and 'modebar' don't have to go through it. Referencing #2227 (comment) where something similar was proposed.alexcjohnson commentedon Apr 19, 2018
Sounds reasonable. Another option - not necessarily mutually exclusive, we could do both in fact - would be to make another collation of subplots that maps each (x|y) axis onto the (y|x) axes it makes subplots with. That should substantially reduce the size and complexity of loops like this.
etpinard commentedon May 14, 2018
Done in #2628.
PR #2628 also added set axis anchors to all sploms except the ones with
showlowerhalf: falseso that the "find main subplot" loop is skipped when we can.etpinard commentedon Oct 3, 2018
From #3070 (comment), 50 dims splom traces spend about 40ms in
axis_autotype.js. Improving perf there could be very beneficial.etpinard commentedon Feb 24, 2020
Referencing #749 - moving away from the "relink everything approach" should speed up
supplyDefaultsin some scenarios.gvwilson commentedon Jun 11, 2024
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson