Skip to content

Commit

Permalink
User thrashing of the compound dimensions cache during batching lower…
Browse files Browse the repository at this point in the history
…s performance #1939
  • Loading branch information
maxkfranz committed Aug 21, 2017
1 parent 1c40b60 commit 0f1761b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/collection/dimensions/bounds.js
Expand Up @@ -48,6 +48,9 @@ elesfn.updateCompoundBounds = function(){
// save cycles for non compound graphs or when style disabled
if( !cy.styleEnabled() || !cy.hasCompoundNodes() ){ return this; }

// save cycles when batching -- but bounds will be stale (or not exist yet)
if( cy.batching() ){ return this; }

let updated = [];

function update( parent ){
Expand Down
4 changes: 4 additions & 0 deletions src/core/notification.js
Expand Up @@ -44,6 +44,10 @@ let corefn = ({
this.notifications( true );
},

batching: function(){
return this._private.batchCount > 0;
},

startBatch: function(){
let _p = this._private;

Expand Down

0 comments on commit 0f1761b

Please sign in to comment.