Skip to content
Snippets Groups Projects
Commit d26d1280 authored by Sujin Philip's avatar Sujin Philip
Browse files

Improve performance of vtkCellIterator.

vtkCellIterator uses vtkPoints and vtkIdList for caching cell data. Every time
an iterator is modified these objects are resetted which updates their modified
time. This involves expensive atomic operationsi, that adds up to a few seconds
for large datasets. This fix removes the resetting since the modified time of
these objects are never used.
parent be2429bd
No related merge requests found
......@@ -99,15 +99,6 @@ vtkCellIterator::vtkCellIterator()
this->Faces = this->FacesContainer.GetPointer();
}
//------------------------------------------------------------------------------
void vtkCellIterator::ResetContainers()
{
this->Points->Reset();
this->PointIds->Reset();
this->Faces->Reset();
this->CellType = VTK_EMPTY_CELL;
}
//------------------------------------------------------------------------------
vtkCellIterator::~vtkCellIterator()
{
......
......@@ -63,6 +63,7 @@
#define vtkCellIterator_h
#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkCellType.h" // For VTK_EMPTY_CELL
#include "vtkObject.h"
#include "vtkNew.h" // For vtkNew
#include "vtkIdList.h" // For inline methods
......@@ -180,7 +181,7 @@ private:
void ResetCache()
{
this->CacheFlags = UninitializedFlag;
this->ResetContainers();
this->CellType = VTK_EMPTY_CELL;
}
void SetCache(unsigned char flags)
......@@ -193,8 +194,6 @@ private:
return (this->CacheFlags & flags) == flags;
}
void ResetContainers();
vtkNew<vtkPoints> PointsContainer;
vtkNew<vtkIdList> PointIdsContainer;
vtkNew<vtkIdList> FacesContainer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment