[vtkusers] 'vtkCellLins' : deleting memory in the destructor is very slow

wc34071209 wangcong34071209 at 126.com
Fri May 9 05:08:03 EDT 2014


Hello everybody,

I am a new user of VTK. When I am using vtkStreamTracer on an unstructured
grid (2 million cells), I found it is very slow after I closed window. The
time is mostly spent on the destructor of vtkCellLinks and I post the source
code below:

vtkCellLinks::~vtkCellLinks()
{
  if ( this->Array == NULL )
    {
    return;
    }

  for (vtkIdType i=0; i<=this->MaxId; i++)
    {
    if ( this->Array[i].cells != NULL )
      {
      delete [] this->Array[i].cells;
      }
    }

  delete [] this->Array;
}

If I have a big grid, then value of MaxId is very big and the time is
consumed within the 'for' cycle.

Does anybody have any clue to the resolution of this problem?

Thank you.




--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkCellLins-deleting-memory-in-the-destructor-is-very-slow-tp5727044.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list