MantisBT - VTK
View Issue Details
0013851VTK(No Category)public2013-02-01 12:212013-04-05 19:01
Matthias Schneider 
Berk Geveci 
normalminorhave not tried
closedfixed 
5.10.1 
 
TBD
performance
0013851: Serious performance issue in vtkGraphs when removing vertices
vtkGraph seems to have a serious bottleneck when removing vertices from the graph structure.

vtkGraph::RemoveVerticesInternal() internally calls vtkGraph::RemoveVertexInternal() which recomputes the edge list structure in every call:

vtkGraph.cxx:1458ff

this->ForceOwnership();
this->BuildEdgeList(); // This function assumes the edge list is created.

I am not totally sure abut the additional comment concerning the assumption.
I could not find any reason for an unconditional update of the edge list so far.
Therefore, I'd suggest to add the following condition:

this->ForceOwnership();
if (!this->EdgeList) {
  this->BuildEdgeList();
}

Other functions seem to call BuildEdgeList() with exactly the same condition.
No tags attached.
Issue History
2013-02-01 12:21Matthias SchneiderNew Issue
2013-02-04 16:30Jean-Christophe Fillion-RobinNote Added: 0030306
2013-02-05 10:50Matthias SchneiderNote Added: 0030308
2013-02-07 09:20Jean-Christophe Fillion-RobinNote Added: 0030317
2013-04-05 19:00Berk GeveciAssigned To => Berk Geveci
2013-04-05 19:00Berk GeveciStatusbacklog => todo
2013-04-05 19:00Berk GeveciStatustodo => active development
2013-04-05 19:00Berk GeveciStatusactive development => gatekeeper review
2013-04-05 19:00Berk GeveciResolutionopen => fixed
2013-04-05 19:01Berk GeveciStatusgatekeeper review => customer review
2013-04-05 19:01Berk GeveciStatuscustomer review => closed

Notes
(0030306)
Jean-Christophe Fillion-Robin   
2013-02-04 16:30   
Hi Matthias,

Thanks for reporting the issue and proposing a patch.

I would recommend you to submit your patch through Gerrit.

See http://www.vtk.org/Wiki/VTK/Git/Develop [^]

Thanks
Jc
(0030308)
Matthias Schneider   
2013-02-05 10:50   
Patch has been submitted:
http://review.source.kitware.com/9620 [^]
(0030317)
Jean-Christophe Fillion-Robin   
2013-02-07 09:20   
Previous patch has been abandoned - See http://review.source.kitware.com/#/c/9640/ [^]