-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Aggressive splom perf #3057
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
Aggressive splom perf #3057
Changes from 1 commit
56f2ee9
3574ece
8d0cac5
8282d91
73acd7e
cc5f0ca
17e30d2
4792f08
f415e96
3eb91c0
145cad3
6de1ae4
aaf6312
478c669
81eb48b
0243451
dcacd78
68dfbc1
c02330c
02263b9
f179c2f
cd8d8ab
0aad7ea
078c086
00cae48
5878223
c2ecb3a
31d5606
ea38664
4137433
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,19 +45,18 @@ function drag(gd) { | |
for(var i = 0; i < cd.length; i++) { | ||
var cd0 = cd[i][0]; | ||
var trace = cd0.trace; | ||
var stash = cd0.t; | ||
var scene = stash._scene; | ||
var scene = fullLayout._splomScenes[trace.uid]; | ||
|
||
if(trace.type === 'splom' && scene && scene.matrix) { | ||
dragOne(gd, trace, stash, scene); | ||
dragOne(gd, trace, scene); | ||
} | ||
} | ||
} | ||
|
||
function dragOne(gd, trace, stash, scene) { | ||
function dragOne(gd, trace, scene) { | ||
var visibleLength = scene.matrixOptions.data.length; | ||
var visibleDims = stash.visibleDims; | ||
var ranges = new Array(visibleLength); | ||
var visibleDims = trace._visibleDims; | ||
var ranges = scene.viewOpts.ranges = new Array(visibleLength); | ||
|
||
for(var k = 0; k < visibleDims.length; k++) { | ||
var i = visibleDims[k]; | ||
|
@@ -168,46 +167,40 @@ function makeGridData(gd) { | |
return gridBatches; | ||
} | ||
|
||
function clean(newFullData, newFullLayout, oldFullData, oldFullLayout, oldCalcdata) { | ||
var oldModules = oldFullLayout._modules || []; | ||
var newModules = newFullLayout._modules || []; | ||
function clean(newFullData, newFullLayout, oldFullData, oldFullLayout) { | ||
oldLoop: | ||
for(var i = 0; i < oldFullData.length; i++) { | ||
var oldTrace = oldFullData[i]; | ||
|
||
var hadSplom, hasSplom; | ||
var i; | ||
if(oldTrace.type === 'splom') { | ||
for(var j = 0; j < newFullData.length; j++) { | ||
var newTrace = newFullData[j]; | ||
|
||
for(i = 0; i < oldModules.length; i++) { | ||
if(oldModules[i].name === 'splom') { | ||
hadSplom = true; | ||
break; | ||
} | ||
} | ||
for(i = 0; i < newModules.length; i++) { | ||
if(newModules[i].name === 'splom') { | ||
hasSplom = true; | ||
break; | ||
} | ||
} | ||
if(oldTrace.uid === newTrace.uid && newTrace.type === 'splom') { | ||
continue oldLoop; | ||
} | ||
} | ||
|
||
if(hadSplom && !hasSplom) { | ||
for(i = 0; i < oldCalcdata.length; i++) { | ||
var cd0 = oldCalcdata[i][0]; | ||
var trace = cd0.trace; | ||
var scene = cd0.t._scene; | ||
|
||
if( | ||
trace.type === 'splom' && | ||
scene && scene.matrix && scene.matrix.destroy | ||
) { | ||
scene.matrix.destroy(); | ||
cd0.t._scene = null; | ||
if(oldFullLayout._splomScenes) { | ||
var scene = oldFullLayout._splomScenes[oldTrace.uid]; | ||
if(scene && scene.destroy) scene.destroy(); | ||
// must first set scene to null in order to get garbage collected | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting... how did you figure this out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checking GPU memory consumption in the Chrome task manager ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, I have to wonder
|
||
oldFullLayout._splomScenes[oldTrace.uid] = null; | ||
delete oldFullLayout._splomScenes[oldTrace.uid]; | ||
} | ||
} | ||
} | ||
|
||
if(Object.keys(oldFullLayout._splomScenes || {}).length === 0) { | ||
delete oldFullLayout._splomScenes; | ||
} | ||
|
||
if(oldFullLayout._splomGrid && | ||
(!newFullLayout._hasOnlyLargeSploms && oldFullLayout._hasOnlyLargeSploms)) { | ||
// must first set scene to null in order to get garbage collected | ||
oldFullLayout._splomGrid.destroy(); | ||
oldFullLayout._splomGrid = null; | ||
delete oldFullLayout._splomGrid; | ||
} | ||
|
||
Cartesian.clean(newFullData, newFullLayout, oldFullData, oldFullLayout); | ||
|
@@ -228,7 +221,7 @@ function updateFx(gd) { | |
var trace = cd0.trace; | ||
|
||
if(trace.type === 'splom') { | ||
var scene = cd0.t._scene; | ||
var scene = fullLayout._splomScenes[trace.uid]; | ||
if(scene.selectBatch === null) { | ||
scene.matrix.update(scene.matrixOptions, null); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.