Performance regression in vtkUnstructuredGridGeometryFilter
I recently upgraded a finite element analysis software from VTK 7.0 to VTK 8.0. Now I experience a huge slow down of the vtkUnstructuredGridGeometryFilter algorithm, which appears to be 2X slower than before.
After doing a bisect which took me some time, it appears the main culprit is MR !776 (merged), but it seems other later commits may have slowed down the algorithm even more.
Here is the small piece of code I used to do the bisect and below is a link to the mesh file.
#include <vtkNew.h>
#include <vtkUnstructuredGridReader.h>
#include <vtkUnstructuredGridGeometryFilter.h>
#include <vtkUnstructuredGrid.h>
#include <vtkPolyDataMapper.h>
#include <chrono>
using namespace std;
using namespace chrono;
int main(int argc, char *argv[])
{
std::string filename = "pipe_mesh.vtk";
vtkNew<vtkUnstructuredGridReader> reader;
reader->SetFileName(filename.c_str());
reader->Update();
vtkNew<vtkUnstructuredGridGeometryFilter> geometryFilter;
geometryFilter->SetInputData(reader->GetOutput());
high_resolution_clock::time_point t1 = high_resolution_clock::now();
geometryFilter->Update();
high_resolution_clock::time_point t2 = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(t2 - t1).count();
cout << duration << " microseconds" << endl;
return EXIT_SUCCESS;
}
On my system (Xeon E5-1603 0/Windows 7/MSVC 2015 64), with VTK 7.0, calling vtkUnstructuredGridGeometryFilter::Update on a big mesh took around 1.2s, while with last master, it takes more than 2.4s.
Here is a link to the mesh I used: https://ufile.io/7x17g
Edited by Boris Basic